Path: utzoo!attcan!uunet!mcvax!unido!tub!uwbln!ckl From: ckl@uwbln.UUCP (Christoph Kuenkel) Newsgroups: comp.unix.wizards Subject: Re: Environment variables at login Keywords: environment login Message-ID: <1623@uwbull.uwbln.UUCP> Date: 3 Jul 89 08:47:06 GMT References: <956@gara.une.oz> Organization: UniWare GmbH, Berlin Lines: 46 In article <956@gara.une.oz>, wtoomey@gara.une.oz (Warren Toomey) writes: > Could anybody tell me where I can put a list of environment variables > [...] that everybody will get at login, regardless of which shell they login We use the following scheme: - each interactive login shell (sh, csh, tcsh, ksh, whatever) gets a link named ``-'' (-sh, -csh, ...) - the systems bourne shell gets one extra link per login shell named ``sh-'' (sh-csh, sh-tcsh...) - any users gets one of the bourne shell links as login shell e.g. user:pw:uid:gid:gecos:home:/bin/sh-csh - any initialization (not only environment setting) is done in /etc/profile - the last statement in /etc/profile overlays the bourne shell with the real login shell, which is selected using $0 % grep -relevant /etc/profile if [ $0 = -sh-csh ]; then SHELL=/bin/csh export SHELL exec -csh fi if [ $0 = sh-csh ]; then SHELL=/bin/csh export SHELL exec csh fi etc. pp. # you could use a case statement instead... the net effect is that any login shell will interpret /etc/profile using /bin/sh and then start up the real shell which will still believe that its the login shell (due to the - linkname) [and thus will - for example - execute ~/.login]. > I've tried putting them in /etc/rc, but for some reason they are not > passed onto the children process at bootup time. the shell which executes rc is a child of init just like all the gettys are. so no environment is passed from rc to gettys :-( And now my question for the wizards: will the problem of setting up an uniform process environment for any interactive and/or non-interactive use be solved in a more elegant fashion in SysVR5 or in some BSD version? -- # include Christoph Kuenkel/UniWare GmbH Kantstr. 152, 1000 Berlin 12, West Germany ck@tub.BITNET ckl@uwbln {unido,tmpmbx,tub}!uwbln!ckl