When is the TZ environment var set?

  • Follow


Greetings:

   We are running Solaris SPARC version 10 and I have a question about the
timezone variable.  We run Apache and when it starts as part of the boot
process, it is apparently starting before the system timezone environment
variable has been set, because it logs everything as GMT (+0000).  If I 
take it down and restart it manually, it logs as Central Time (-0600) which
is what I want it to do.  I moved the startup from /etc/rc2.d to /etc/rc3.d
thinking that would fix it but it didn't.  Is the timezone available when
scripts in /etc/rc3.d are run?  Or am I doing something else wrong?  FWIW,
I have not noticed this behavior on any of our web servers running Apache
under Solaris 9.  Thanks for any advice.

Jim McCullars
University of Alabama in Huntsville

0
Reply Jim 1/12/2007 4:28:06 PM

In article <eo8cum$l1$1@news.uah.edu>,
	Jim McCullars <jim@info2.uah.edu> writes:
> Greetings:
> 
>    We are running Solaris SPARC version 10 and I have a question about the
> timezone variable.  We run Apache and when it starts as part of the boot
> process, it is apparently starting before the system timezone environment
> variable has been set, because it logs everything as GMT (+0000).  If I 
> take it down and restart it manually, it logs as Central Time (-0600) which
> is what I want it to do.  I moved the startup from /etc/rc2.d to /etc/rc3.d
> thinking that would fix it but it didn't.  Is the timezone available when
> scripts in /etc/rc3.d are run?  Or am I doing something else wrong?  FWIW,
> I have not noticed this behavior on any of our web servers running Apache
> under Solaris 9.  Thanks for any advice.

init (process 1) picks it up from /etc/default/init,
and everything else inherits it from that.

-- 
Andrew Gabriel
0
Reply andrew 1/12/2007 5:06:54 PM


Jim McCullars <jim@info2.uah.edu> wrote:
> Greetings:

>    We are running Solaris SPARC version 10 and I have a question about the
> timezone variable.  We run Apache and when it starts as part of the boot
> process, it is apparently starting before the system timezone environment
> variable has been set, because it logs everything as GMT (+0000).  If I 
> take it down and restart it manually, it logs as Central Time (-0600) which
> is what I want it to do.  I moved the startup from /etc/rc2.d to /etc/rc3.d
> thinking that would fix it but it didn't.  Is the timezone available when
> scripts in /etc/rc3.d are run?  Or am I doing something else wrong?  FWIW,
> I have not noticed this behavior on any of our web servers running Apache
> under Solaris 9.  Thanks for any advice.

init reads it normally, so everything inherits it from there.  Is there
any chance you're running it out of a chroot environment that doesn't
have the timezones within the chroot tree?

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 1/15/2007 12:26:17 AM

Darren Dunham <ddunham@redwood.taos.com> wrote:
> Jim McCullars <jim@info2.uah.edu> wrote:
>> timezone variable.  We run Apache and when it starts as part of the boot
>> process, it is apparently starting before the system timezone environment
>> variable has been set, because it logs everything as GMT (+0000).  If I 
>> take it down and restart it manually, it logs as Central Time (-0600) which

> init reads it normally, so everything inherits it from there.  Is there
> any chance you're running it out of a chroot environment that doesn't
> have the timezones within the chroot tree?

  No, but I think I found the culprit.  We use logadm to keep the log files
from growing to an unmanageable size, and I noticed that after logadm has
restarted Apache it goes back to logging in UTC time.  So maybe that (rather
than the boot start) is what was doing it all along.  I think I can get
around the problem by playing with logadm.conf (specifically the -a part).
Thanks for the feedback...

Jim McCullars
University of Alabama in Huntsville
0
Reply Jim 1/18/2007 9:13:41 PM

In <eoonu5$s4i$1@news.uah.edu> Jim McCullars <jim@info2.uah.edu> writes:

>Darren Dunham <ddunham@redwood.taos.com> wrote:
>> Jim McCullars <jim@info2.uah.edu> wrote:
>>> timezone variable.  We run Apache and when it starts as part of the boot
>>> process, it is apparently starting before the system timezone environment
>>> variable has been set, because it logs everything as GMT (+0000).  If I 
>>> take it down and restart it manually, it logs as Central Time (-0600) which

>> init reads it normally, so everything inherits it from there.  Is there
>> any chance you're running it out of a chroot environment that doesn't
>> have the timezones within the chroot tree?

>  No, but I think I found the culprit.  We use logadm to keep the log files
>from growing to an unmanageable size, and I noticed that after logadm has
>restarted Apache it goes back to logging in UTC time.  So maybe that (rather
>than the boot start) is what was doing it all along.  I think I can get
>around the problem by playing with logadm.conf (specifically the -a part).

Here's what I use for apache in logadm.conf:

apache -C 6 -N -a '/usr/apache/bin/apachectl graceful > /dev/null' '/var/apache/logs/*{access,error,suexec}_log'
apache2 -C 6 -N -a '/usr/apache2/bin/apachectl graceful' '/var/apache2/logs/*{access,error,suexec}_log'
/var/apache/logs/access_log -P 'Tue Jan 16 09:10:00 2007' -N
/var/apache/logs/error_log -P 'Tue Jan 16 09:10:00 2007' -N
/var/apache/logs/suexec_log -P 'Mon Jan 15 09:10:00 2007' -N
/var/apache2/logs/access_log -N
/var/apache2/logs/error_log -N
/var/apache2/logs/suexec_log -N

-- 
-Gary Mills-    -Unix Support-    -U of M Academic Computing and Networking-
0
Reply Gary 1/18/2007 10:33:35 PM

4 Replies
766 Views

(page loaded in 0.059 seconds)

Similiar Articles:













7/22/2012 4:24:34 PM


Reply: