paine@fungus.enet.dec.com (Willy Paine) (03/10/90)
I have ix/386 2.0.2 and I set up for PST time but the default date shows in EST instead of PST. Under user's shell environment, I can use TZ=PST8PDT but I have couple of bbs login that run standalone bbs program that have no shell or environment. Users are reading EST time inside bbs software instead of EST. It must be able to set up default time to PST in startup program like rc or rc2 or rc*. Thanks in advance. willy
paine@fungus.enet.dec.com (Willy Paine) (03/10/90)
I have ix/386 2.0.2 and I set up for PST time but the default date shows in EST instead of PST. Under user's shell environment, I can use TZ=PST8PDT but I have couple of bbs login that run standalone bbs program that have no shell or environment. Users are reading EST time inside bbs software instead of EST. It must be able to set up default time to PST in startup program like rc or rc2 or rc*. Thanks in advance. willy
root@usaos.UUCP (Warren Calhoun) (03/10/90)
In article <9003092109.AA09255@decwrl.dec.com>, paine@fungus.enet.dec.com (Willy Paine) writes: > > > I have ix/386 2.0.2 and I set up for PST time but the default date shows > in EST instead of PST. Under user's shell environment, I can use > TZ=PST8PDT but I have couple of bbs login that run standalone bbs > program that have no shell or environment. Users are reading EST time > inside bbs software instead of EST. It must be able to set up default > time to PST in startup program like rc or rc2 or rc*. > > Thanks in advance. > > willy > As I also run 386/ix, I stopped to do a quick check for you. When your system boots, there should be a line in /etc/inittabs invoking bcheckrc. The file /etc/bcheckrc should (among other things) contain the line; . /etc/TIMEZONE ...which should contain the lines; TZ=EST5EDT (in my case) export TZ This would alleviate the necessity for any other use of a TZ= line. It will also place the TZ shell variable in the global environment. If, as you say, the bbs software has no shell or environment (which I don't understand, but then, I'm no guru [yet]) this probably wouldn't help. On the other hand, if you mean that the bbs software executes directly from a line in /etc/passwd, then this will work as the program should still reference variables in the global environment. Hope this helps =============================================================================== W.D. "Cal" Calhoun | I tried to 'Be all I could be' U.S. Army Ordnance School, Ft Belvoir, VA | Then the Army told me I was fat. calhoun@usaos.UUCP (usaos!calhoun) | Go Figure ===============================================================================
cpcahil@virtech.uucp (Conor P. Cahill) (03/10/90)
In article <9003092053.AA07364@decwrl.dec.com> paine@fungus.enet.dec.com (Willy Paine) writes: >I have ix/386 2.0.2 and I set up for PST time but the default date shows >in EST instead of PST. Under user's shell environment, I can use >TZ=PST8PDT but I have couple of bbs login that run standalone bbs >program that have no shell or environment. Users are reading EST time >inside bbs software instead of EST. It must be able to set up default >time to PST in startup program like rc or rc2 or rc*. If you set up the /etc/TIMEZONE file correctly (see timezone(4)), the rc2 script, which runs all the rc2.d startup scripts, will automatically pick it up. Instead of placing a TZ= into the /etc/profile, or any individual user's login .profile, you should place a ". /etc/TIMEZONE". -- Conor P. Cahill (703)430-9247 Virtual Technologies, Inc., uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160 Sterling, VA 22170
cpcahil@virtech.uucp (Conor P. Cahill) (03/12/90)
In article <21@usaos.UUCP> root@usaos.UUCP (Warren Calhoun) writes: >In article <9003092109.AA09255@decwrl.dec.com>, paine@fungus.enet.dec.com (Willy Paine) writes: >> [question of how to get timezone correct for non-logins deleted] >As I also run 386/ix, I stopped to do a quick check for you. When your >system boots, there should be a line in /etc/inittabs invoking bcheckrc. >The file /etc/bcheckrc should (among other things) contain the line; > > . /etc/TIMEZONE > >...which should contain the lines; > > TZ=EST5EDT (in my case) > export TZ > >This would alleviate the necessity for any other use of a TZ= line. It Placing the TZ stuff into the /etc/TIMEZONE file does in fact solve the problem, but it is not because the /etc/bcheckrc file reads the file. It is because /etc/init reads the file and processes (places into its environment) all the VAR=junk lines. You could almost say that /etc/TIMEZONE acts as an 'rc' file for init. /etc/bcheckrc is just a shell run by init (because of an entry in /etc/inittab) when entering multi-user mode (leaving single user mode). Any environment variables set or changed there will have no effect on the environment for any other program. -- Conor P. Cahill (703)430-9247 Virtual Technologies, Inc., uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160 Sterling, VA 22170
root@usaos.UUCP (Warren Calhoun) (03/12/90)
In article <1990Mar11.231937.15412@virtech.uucp>, cpcahil@virtech.uucp (Conor P. Cahill) writes: > In article <21@usaos.UUCP> root@usaos.UUCP (Warren Calhoun) writes: > >In article <9003092109.AA09255@decwrl.dec.com>, paine@fungus.enet.dec.com (Willy Paine) writes: > >> [question of how to get timezone correct for non-logins deleted] > > >As I also run 386/ix, I stopped to do a quick check for you. When your > >system boots, there should be a line in /etc/inittabs invoking bcheckrc. > >The file /etc/bcheckrc should (among other things) contain the line; > > > > . /etc/TIMEZONE > > > >...which should contain the lines; > > > > TZ=EST5EDT (in my case) > > export TZ > > > >This would alleviate the necessity for any other use of a TZ= line. It > > Placing the TZ stuff into the /etc/TIMEZONE file does in fact solve the > problem, but it is not because the /etc/bcheckrc file reads the file. It > is because /etc/init reads the file and processes (places into its > environment) all the VAR=junk lines. You could almost say that /etc/TIMEZONE > acts as an 'rc' file for init. > > /etc/bcheckrc is just a shell run by init (because of an entry in /etc/inittab) > when entering multi-user mode (leaving single user mode). Any environment > variables set or changed there will have no effect on the environment > for any other program. > I suppose that it's possible that I misunderstood my bcheckrc file. Why, then is the . /etc/TIMEZONE line in it and why does /etc/TIMEZONE export the TZ variable if init does it directly? #ident "@(#)bcheckrc 1.0 - 90/01/11" # This file has those commands necessary to check the file systems, # date, and anything else that should be done before mounting the # file systems. #! chmod +x ${file} rootfs=/dev/root /etc/fsstat ${rootfs} >/dev/null 2>&1 if [ $? -ne 0 ] then /etc/dumpsave echo "fsstat: The root file system is in need of repair." echo "The root file system (${rootfs}) will be repaired automatically." /etc/fsck -y -s -D -b ${rootfs} fi trap "" 2 . /etc/TIMEZONE echo "The date is `date`" /etc/devnm / | grep -v swap | /etc/setmnt +-------------------------------------------+---------------------------------+ | W.D. "Cal" Calhoun | | | U.S. Army Ordnance School, Ft Belvoir, VA | Under Construction | | calhoun@usaos.UUCP (usaos!calhoun) | | +-------------------------------------------+---------------------------------+
guy@auspex.auspex.com (Guy Harris) (03/13/90)
>Instead of placing a TZ= into the /etc/profile, or any individual user's >login .profile, you should place a ". /etc/TIMEZONE". Even that shouldn't be necessary, in S5R3.1 and later (maybe even S5R3.0), since: 1) as you noted elsewhere, "init" reads "/etc/TIMEZONE" and sets up the environment from it; 2) "login" - at least in the 3B2 source version of S5R3.1 - preserves the value of "TZ". If it *is* necessary, somebody screwed up badly.
cpcahil@virtech.uucp (Conor P. Cahill) (03/13/90)
In article <22@usaos.UUCP> root@usaos.UUCP (Warren Calhoun) writes: >In article <1990Mar11.231937.15412@virtech.uucp>, cpcahil@virtech.uucp (Conor P. Cahill) writes: >> Placing the TZ stuff into the /etc/TIMEZONE file does in fact solve the >> problem, but it is not because the /etc/bcheckrc file reads the file. It >> is because /etc/init reads the file and processes (places into its >> environment) all the VAR=junk lines. You could almost say that /etc/TIMEZONE >> acts as an 'rc' file for init. > >I suppose that it's possible that I misunderstood my bcheckrc file. Why, then >is the . /etc/TIMEZONE line in it and why does /etc/TIMEZONE export the TZ >variable if init does it directly? Who knows? It is probably an old mechanism that was in place before init read the /etc/TIMEZONE file. Or it may be an indication that some time in the future init might not read the file. Or it could be that they want to make sure that even if there are too many variables in the TIMEZONE file for init to process (according to Guy Harris the count was 5 in System V R3.1) the shell would get it right. BTW - you will find that there probably are lots of shells in the system that source the /etc/TIMEZONE file including /etc/profile and /etc/rc2, probably for the same reason as /etc/bcheckrc. -- Conor P. Cahill (703)430-9247 Virtual Technologies, Inc., uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160 Sterling, VA 22170
jon@wilbur.uucp (Jonathan C. Broome) (03/13/90)
In article <3022@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
: >login .profile, you should place a ". /etc/TIMEZONE".
: Even that shouldn't be necessary, in S5R3.1 and later (maybe even
: S5R3.0), since:
: 2) "login" - at least in the 3B2 source version of S5R3.1 -
: preserves the value of "TZ".
/bin/login reads the file /etc/default/login, looking for a line starting
with "TIMEZONE=". If it finds one, it sets TZ=<rest of line>. Thus, login
will not preserve TZ. Fix this line to have the correct value, or simply
remove the line altogether.
---Jonathan Broome
jon@wilbur.uucp ...!uunet!ism780c!wilbur!jon
mrm@sceard.Sceard.COM (M.R.Murphy) (03/14/90)
In article <3022@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >>Instead of placing a TZ= into the /etc/profile, or any individual user's >>login .profile, you should place a ". /etc/TIMEZONE". > >Even that shouldn't be necessary, in S5R3.1 and later (maybe even >S5R3.0), since: > > 1) as you noted elsewhere, "init" reads "/etc/TIMEZONE" and sets > up the environment from it; > > 2) "login" - at least in the 3B2 source version of S5R3.1 - > preserves the value of "TZ". > >If it *is* necessary, somebody screwed up badly. Doesn't anybody have users that log into their machines from different timezones? And that want the timezone they want. I think that EST has, well, kind of a traditional feel to it. Sort of New Jerseyish, no disrespect intended. WRT timezones in general, Unix(tm) does seem to come in more than one flavo(u)r. What do we expect, standards? :-) -- Mike Murphy Sceard Systems, Inc. 544 South Pacific St. San Marcos, CA 92069 mrm@Sceard.COM {hp-sdd,nosc,ucsd,uunet}!sceard!mrm +1 619 471 0655
guy@auspex.auspex.com (Guy Harris) (03/15/90)
>/bin/login reads the file /etc/default/login, looking for a line starting >with "TIMEZONE=". If it finds one, it sets TZ=<rest of line>. Thus, login >will not preserve TZ. That's appallingly dumb of it. I presume you're discussing the 386 flavor of S5, or some derivative thereof, or a release subsequent to S5R3.1, 'cuz that "feature" ain't in the 3B2 source I mentioned. Unless the 386 version in question didn't manage to pick up the S5R3.1 feature of having "init" able to read "/etc/TIMEZONE" and initialize the environment from there, either: by virtue of being derived from a pre-S5R3.1 base (in which case it should be updated to such an S5R3.1-or-later base), or by virtue of having forked off before there (demonstrating why it is usually a Very Bad Idea to fork off the entire source for a release merely because it's being built for a different processor), there was no reason why "/etc/default/login" should have a "TIMEZONE=" entry in it, except perhaps for the convenience of sites with the processor in one time zone and the vast majority of the users logging in from another time zone. If the latter is the case, then by default "/etc/default/login" should *not* be set up to include a "TIMEZONE=" line, since I find it extremely unlikely that the case mentioned (processor in one time zone, users in another) is the most likely case.... The impression I've gotten is that the 386 S5's are S5R3.2-based. I don't know whether this little "TIMEZONE=" feature in "/etc/default/login" snuck into S5R3.2, or was added by somebody doing the 386 version. In either case, it should perhaps sneak back out again through the back door....
guy@auspex.auspex.com (Guy Harris) (03/16/90)
>Doesn't anybody have users that log into their machines from different >timezones? And that want the timezone they want. Yup, they can just set TZ in their own ".profile"/".login" files, if the system default isn't appropriate. >WRT timezones in general, Unix(tm) does seem to come in more than one >flavo(u)r. What do we expect, standards? Yup. I expect the Arthur Olson code to be the standard within a few years, since both System V Release 4 and 4.3-tahoe support it....