friedl@vsi.UUCP (Stephen J. Friedl) (05/19/88)
Hi net.folks, We've just tracked down a really ugly bug in SVR3 for the 3B2 that can prevent init from working properly. We present this in the hopes that you don't get burned like we did. SUMMARY OF BUG (you're not going to believe this): commented lines in /etc/TIMEZONE that contain equal signs will cause the system to fail to enter multiuser mode. FIX: delete the lines or remove the equal signs. BACKGROUND: Recall that init(1m) reads /etc/TIMEZONE to grab up to five environment variables (TZ, usually) and puts them in the environment for all its children. Because init appears to take *any* lines that contain an = sign without respect to comments, a bogus variable assignment could be made that /bin/sh will not accept. This will cause the shell to exit and not run anything out of inittab. A customer was upgrading from 2.0.4 to 3.1, and his /etc/TIMEZONE file had the following in it: # set the timezone <TAB> TZ=PST8PDT #<TAB> TZ=PST7PDT Init runs all its commands with: /bin/sh -c "exec COMMAND" and it appeared that each command was failing immediately. We put a front-end onto /bin/sh to attach stdin+out+err to /dev/console (normally it's not connected to anything when run from init) so we could see the error message, and it said something like: sh: "#^ITZ=PST7PDT": not an identifier Obviously, init was picking this up from /etc/TIMEZONE. Deleting the line from the file fixed the problem and allowed everything to run. Note that we have not done extensive research on this, and our assumptions on the equal sign being significant are just guesses (we just deleted the line to fix the problem). Nevertheless, this looks like a pretty easy fix for some kind soul at AT&T to do... Anybody else seen this? Steve -- Steve Friedl V-Systems, Inc. (714) 545-6442 3B2-kind-of-guy friedl@vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl
cyliax@ea.ecn.purdue.edu (Ingo Cyliax) (05/19/88)
In article <675@vsi.UUCP> friedl@vsi.UUCP (Stephen J. Friedl) writes: >Hi net.folks, > A customer was upgrading from 2.0.4 to 3.1, and his >/etc/TIMEZONE file had the following in it: > > # set the timezone > <TAB> TZ=PST8PDT > #<TAB> TZ=PST7PDT > > Init runs all its commands with: > > /bin/sh -c "exec COMMAND" > ..... > > sh: "#^ITZ=PST7PDT": not an identifier Sounds like a bug in Sys V sh, it should just ignore lines that start with "#". It should do something like this ... : Script started on Thu May 19 10:44:30 1988 cyliax.ea % cat > t.out # echo Hello World echo Hello World cyliax.ea % chmod +x t.out cyliax.ea % sh -c "exec t.out" Hello World cyliax.ea % script done on Thu May 19 10:45:19 1988 Note that this only printed 1 "Hello World" !. -- /* Ingo Cyliax * * ...!ihnp4!pur-ee!cyliax ECN, Electrical Engineering Bldg. * * cyliax@ecn.purdue.edu Purdue University, W. Lafayette,IN 47907 * * ing@cc.purdue.edu (317) 494-3473 / (317) 463-1747 after 5pm */