This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cannot initialize bash shell after Cygwin 1.5.24 install
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 31 Aug 2009 13:20:17 +0100
- Subject: Re: Cannot initialize bash shell after Cygwin 1.5.24 install
- References: <971022.41270.qm@web111620.mail.gq1.yahoo.com>
Doug Ruff wrote:
> I installed using my domain user account (dougruff), and when the
> installation completed, I was able to launch a bash shell in my login
> session without any problems.
>
> But as soon as another user logs into this system and starts Cygwin bash,
> they are greeted with an uninitialized Bash shell (no path is set, no
> prompt is set, etc.)
>
> There is no HOME variable set in Windows. Nor is there an entry in
> /etc/passwd for my account (dougruff).
Is there a HOMEDRIVE/HOMEPATH setting for them?
> What could be keeping other users from being able to get a properly
> initialized shell session on this machine?
Not entirely sure, let's find out.
The mechanism that detects when a new user starts up a shell for the first
time and creates their home directory and copies the default startup scripts
into it for them lives in /etc/profile, beginning here:
> # Here is how HOME is set, in order of priority, when starting from Windows
> # 1) From existing HOME in the Windows environment, translated to a Posix path
> # 2) from /etc/passwd, if there is an entry with a non empty directory field
> # 3) from HOMEDRIVE/HOMEPATH
> # 4) / (root)
>
> # If the home directory doesn't exist, create it.
> if [ ! -d "${HOME}" ]; then
You need to find out why it isn't working for them. Since the way it works
is to see if the user's home directory already exists, if there's a valid
HOMEDRIVE/HOMEPATH combination for the users, and they don't have /etc/passwd
entries, it won't get tripped.
If that's the case, there's two ways you could easily fix it, depending
whether the other users wanted to use HOMEDRIVE/HOMEPATH as their cygwin home
directory or whether they wanted home directories under /home/$USER:
- to use the existing homedrive/path combination, just copy all the files from
/etc/skel into the existing dir. (If you're using cygwin's 'cp' to do so,
watch out - they all begin with a '.', i.e. hidden filenames)
- to get a fresh home dir in the standard place, unset those variables for the
users in question. Next time they login /etc/profile will run and set it up
for them.
- or, to get a fresh home dir without unsetting those variables, make sure to
create entries in /etc/passwd for them (using 'mkpasswd', presumably with the
-d option to add entries for domain users), and make sure the home dir path is
set how you want it in that entry.
cheers,
DaveK
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple