From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7220 invoked from network); 17 Oct 2004 19:03:24 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Oct 2004 19:03:24 -0000 Received: (qmail 27953 invoked from network); 17 Oct 2004 18:56:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Oct 2004 18:56:38 -0000 Received: (qmail 17930 invoked by alias); 17 Oct 2004 18:56:24 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8064 Received: (qmail 17916 invoked from network); 17 Oct 2004 18:56:22 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Oct 2004 18:56:22 -0000 Received: (qmail 26591 invoked from network); 17 Oct 2004 18:55:22 -0000 Received: from mail.vc-graz.ac.at (HELO proxy.vc-graz.ac.at) (193.171.121.30) by a.mx.sunsite.dk with SMTP; 17 Oct 2004 18:55:21 -0000 Received: from localhost (b-55.vc-graz.ac.at [193.171.241.55]) by proxy.vc-graz.ac.at (8.12.11/8.12.11) with ESMTP id i9HItKxa016873 for ; Sun, 17 Oct 2004 20:55:20 +0200 (MEST) Date: Sun, 17 Oct 2004 20:55:20 +0200 From: Michael Prokop To: zsh-users@sunsite.dk Subject: Re: Change directory on invocation of zsh Message-ID: <2004-10-17T20-44-57@devnull.michael-prokop.at> Reply-To: Michael Prokop Mail-Followup-To: zsh-users@sunsite.dk References: <2004-10-16T23-18-26@devnull.michael-prokop.at> <2004-10-17T16-22-44@devnull.michael-prokop.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-URL: http://www.michael-prokop.at/ X-Operating-System: Debian GNU/Linux - 2.6.8.1 on a i686 X-Registered-Linux-User: 224337 X-Crypto: GnuPG/1.2.3 http://www.gnupg.org X-GPG-Key-ID: 0x37E272E8 X-GPG-Key: http://www.michael-prokop.at/gpg X-GPG-Fingerprint: 04AE E62C 9502 CD34 A7DA 857B D8DF 53FB 37E2 72E8 User-Agent: Mutt/1.5.6i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_44 autolearn=no version=2.63 X-Spam-Hits: -0.0 * Bart Schaefer [20041017 18:28]: > On Sun, 17 Oct 2004, Michael Prokop wrote: > > * Bart Schaefer [20041017 10:13]: > > > if (( EUID == 0 )); then > > > export HOME=/root > > > else > > > export HOME=/home/$LOGNAME > > > fi > > /etc/zsh/zshrc:cd:22: no such file or directory: /home/LOGIN > > $ echo $LOGNAME > > LOGIN > Hm. This means that one of the following occurred: > - getlogin() returned "LOGIN" > - getlogin() returned empty or null, and getpwuid() returned an entry for > the user named "LOGIN" [.../rungetty-1.2]$ grep LOGIN rungetty.c #ifndef _PATH_LOGIN #define _PATH_LOGIN "/bin/login" #define LOGIN " login: " /* login prompt */ strncpy (ut.ut_user, "LOGIN", sizeof (ut.ut_user)); ut.ut_type = LOGIN_PROCESS; write (1, LOGIN, sizeof (LOGIN) - 1); execl (_PATH_LOGIN, _PATH_LOGIN, "-f", autologin_name, NULL); execl (_PATH_LOGIN, _PATH_LOGIN, "--", logname, NULL); error ("%s: can't exec " _PATH_LOGIN ": %s", tty, sys_errlist[errno]); [.../rungetty-1.2]$ > I'd have to guess this is a side-effect of autologin? Does it run as the > user "LOGIN"? This seems to be a side-effect of rungetty's autologin, yes. rungetty should run as user root or as the user specified in /etc/inittab, in my case this is user 'grml': 4:2345:respawn:/sbin/rungetty tty4 -u grml -g grml --autologin grml /bin/zsh I'm in contact with the debian maintainer of the rungetty-package. > > I can't find the reason for this behaviour (inittab entries are the > > same and behaviour seems to change when booting system serveral > > times), but using `id -un` instead of $LOGNAME seems to fix it. > If you can't figure out how to get it to be consistent, I'd suggest adding > to /etc/zsh/zshenv this snippet: > [[ $LOGNAME == LOGIN ]] && LOGNAME=$(id -un) > Do that before the EUID/HOME snippet. Other things may be depending on > LOGNAME being set correctly, too. Thanks, works like a charme! regards, (-: Michael