delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/31/08:06:49

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4A9BC001.6070201@gmail.com>
Date: Mon, 31 Aug 2009 13:20:17 +0100
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Cannot initialize bash shell after Cygwin 1.5.24 install
References: <971022 DOT 41270 DOT qm AT web111620 DOT mail DOT gq1 DOT yahoo DOT com>
In-Reply-To: <971022.41270.qm@web111620.mail.gq1.yahoo.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019