This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unattended installation of the entire Cygwin build


----- Original Message ----- 
From: "Dave Korn" <>
To: <cygwin-apps>
Sent: Wednesday, April 11, 2007 2:14 PM
Subject: RE: Unattended installation of the entire Cygwin build


| On 11 April 2007 18:57, Sarah Thompson wrote:
| 
| > The installer seems to work as expected, entirely 'hands-free'
| > so-to-speak, installing the entire list of downloaded packages, but for
| > some reason it fails to create a home directory for the currently logged
| > in user and it fails to source the necessary profiles when Bash is
| > started from the short cut, so the path is somewhat minimal and you just
| > get a 'bash-3.2$' prompt rather than the usual customised version.
| 
|  Yes, that's not part of setup's job.  It happens the first time you fire up
| a bash shell: default profile scripts are copied from /etc/skel, and you are
| instructed to run mkpasswd and mkgroup with the -l or -d (or both) switches to
| set up the passwd and groups files.  Take a look at /etc/profile:
| 
| # If the home directory doesn't exist, create it.
| 
| and
| 
| # Check to see if mkpasswd/mkgroup needs to be run try and cut down the emails
| #   about this on the lists!
| 
| > Any help you could give in finding a workaround for this would be
| > gratefully appreciated.
| 
|  Well, crudely speaking, you could probably add a call to the system()
| function to invoke the Cygwin.bat script in the cygwin root dir.  That would
| copy the skeleton files across to the user's new $HOME, but you'd still need
| to get the passwd and groups files set up somehow.  You could use system()
| calls to invoke mkpasswd and mkgroup as well, or you could add a script
| somewhere, and just invoke that; there's probably half-a-dozen ways of doing
| it that amount to the same thing but differ in minor details.
| 

Actually the passwd/group files are run in the base-passwd postinstall, and it's 
all you need for local users. For domain users you need to run with -d, which
we found risky to do unattended (there are companies with thousands of users,
and also the PC may not be connected to the PDC).

Rather than running system, you could modify the bash shortcut to run with the
--login flag, which would pull the skeleton files.

By the way, /etc/profile should check if mkdir -p "${HOME}"
 succeeds before blindly trying to install the skeletons. If it fails
HOME should be / .

Pierre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]