[comp.mail.uucp] Timezone trouble in inews, smail...

pete@octopus.UUCP (Pete Holzmann) (03/22/88)

As a non-source-licensed uucp site, we've had to live with the sad fact that
our particular Unix is configured with a default east coast timezone. That's
fine; we can set the TZ variable all over the place. Unfortunately, many
programs don't call tzset() [ctime(3c)] to pull TZ setting into the c library
environment at run time. In addition, I must not have figured out *all* the
places where I should set TZ. I need help with the latter, and I think there
are a few bugs in news and smail caused by the former.

The symptoms:

	- smail was always using eastern time in mail headers until I added
		a tzset() call.
	- both smail logs and news logs use different timezones for logging
		incoming and outgoing mail (outgoing uses local time, incoming
		uses eastern time). Presumably this is because TZ isn't set
		right when inews/smail is called from uucico? Where do I
		set TZ to get this right?

What can you do to help?

	- I don't find any calls to tzset in the news software. Yet sometimes
		inews gets the time zone right in the log file. So clearly
		I don't have the whole picture. Maybe somebody with source can
		grep for a better answer.

	- Beta sites for news/smail/etc who are able, should set up their
		machines so the default timezone is NOT their local time zone.
		They will be able to help find these problems, and propagate
		any required solutions.

	- Where else do I need to set up the correct time zone? I have it in
		/.profile (set TZ...), and in /etc/timezone. (This is V.2
		with some Berkeleyisms added).

Pete
-- 
  OOO   __| ___      Peter Holzmann, Octopus Enterprises
 OOOOOOO___/ _______ USPS: 19611 La Mar Court, Cupertino, CA 95014
  OOOOO \___/        UUCP: {hpda,pyramid}!octopus!pete
___| \_____          Phone: 408/996-7746

kennedy@tolerant.UUCP (Bill Kennedy) (03/23/88)

In article <175@octopus.UUCP> pete@octopus.UUCP (Pete Holzmann) writes:
>As a non-source-licensed uucp site, we've had to live with the sad fact that
>our particular Unix is configured with a default east coast timezone. That's
[ discussion and symptoms of the problem deleted ]

The problem lies in the default environment that is inherited by cron and his
friends.  There are several ways around it.  For cron you can make sure that
he gets an environment with TZ set correctly before it starts from /etc/rcxxx
or restarts (my system kills and restarts cron daily as part of clean up).

That doesn't help you with uucico or others that don't necessarily have an
environment where TZ is guaranteed.  To solve those you can write a dirt
simple little program that puts the appropriate TZ stuff in a string
variable and execve to the original binary that didn't have one.  The same
could be done with a script.  We renamed the "real" uucico to uucico.exec
and the front end program uucico.  All it did was get TZ right and pass it
to uucico.exec.  There's probably a more elegant way to do it but I know
that either of these will work.

>	- I don't find any calls to tzset in the news software. Yet sometimes
>		inews gets the time zone right in the log file. So clearly
>		I don't have the whole picture. Maybe somebody with source can
>		grep for a better answer.

Any program who has an appropriate environment will get it right.  If you are
in doubt about who does and doesn't you can schedule them out of at or cron
and send the date output to a log file and see if it comes up with EST (no
environment) or PST (desired environment) and adjust accordingly.

>	- Where else do I need to set up the correct time zone? I have it in
>		/.profile (set TZ...), and in /etc/timezone. (This is V.2
>		with some Berkeleyisms added).

The /etc/profile is only valid for user logins that execute a shell.  The
uucp logins go through uucico (default environment) and depending on how
you are doing news, you are getting uuxqt's environment or cron's.  I can
send you some code fragments to make it what you want but I think you can
see where I am going.  I would *not* recommend that you use a script to get
to uucico, a binary is easier to control.

The opinions are my own, Tolerant is nice enough to let me use their equipment
so don't blame me on them.

Bill Kennedy {rutgers,cbosgd,ihnp4!petro}!ssbn!bill or bill@ssbn.WLK.COM