Operating System - HP-UX
1845947 Members
3755 Online
110250 Solutions
New Discussion

Re: Problems with Timezone

 
SOLVED
Go to solution

Problems with Timezone

Hello all,

i have running an a-class server with hp-ux 11.00

All users, but not rrot, are using the false timezone. Root is using MET-1METDST, the others are using EDT.

I have searched in /etc/TIMEZONE, in /etc/profile and in the .profile`s from the users.

Is there any idea what i have to change that the users are using the right timezone?

thx for help... :-)
17 REPLIES 17
harry d brown jr
Honored Contributor

Re: Problems with Timezone

my /etc/TIMEZONE looks like this:

TZ=EST5EDT
export TZ

Are you running NTP??

ps -ef | grep ntp
grep -v "^\#" /etc/ntp.conf

Are the users "sourcing" in any other PROFILES from their .profiles ?

Did you check the other PROFILES like .kshrc ?

live free or die
harry d brown jr
Live Free or Die
Pete Randall
Outstanding Contributor

Re: Problems with Timezone

Frank,

I would suggest re-setting the system timezone to make sure that's right:

/sbin/set_parms timezone


Pete

Pete

Re: Problems with Timezone

i cannot use set_parms cause set_parms needs an reboot to take affect.

But yes, we have running xntpd. Some of the users are sourcing other profiles, but there is no export=TZ in the profiles. My /etc/TIMEZONE looks "TZ=MET-1METDST". I dont know why the users do not source it....
The /etc/ntp.conf looks good.

harry d brown jr
Honored Contributor

Re: Problems with Timezone

Can you have a non-root user go to a shell prompt and do this:

echo $TZ

env

set

and post the results?

live free or die
harry d brown jr
Live Free or Die

Re: Problems with Timezone

Sure! :-)
set.out=
COLUMNS=80
EDITOR=vi
ERASE=^H
ERRNO=0
FCEDIT=/usr/bin/ed
HISTFILE=/ORACLE/home/oracle/.hist_file.pts0
HISTSIZE=1024
HOME=/ORACLE/home/oracle
IFS='
'
LD_LIBRARY_PATH=/ORACLE/u01/app/oracle/product/9.2.0.6/lib:/usr/dt/lib
LINENO=1
LINES=43
LOGNAME=oracle
MAILCHECK=600
MANPATH=/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/u
sr/local/man/%L:/usr/local/man:/opt/upgrade/share/man/%L:/opt/upgrade/share/man:
/usr/dt/share/man:/opt/pd/share/man/%L:/opt/pd/share/man:/opt/ignite/share/man/%
L:/opt/ignite/share/man:/opt/samba/man:/opt/resmon/share/man:/opt/pred/share/man
/%L:/opt/pred/share/man:/opt/hparray/share/man/%L:/opt/hparray/share/man:/opt/pe
rf/man/%L:/opt/perf/man:/opt/OV/man/itose/%L:/opt/OV/man/itose:/opt/ssh/share/ma
n
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
NO_TERM=0
OBK_HOME=/ORACLE/u01/app/oracle/product/9.2.0.6
OPTARG
OPTIND=1
ORACLE_BASE=/ORACLE/u01/app/oracle
ORACLE_DATA=/DBKSCZ/u02/oradata/DBKSCZ
ORACLE_DOC=/ORACLE/u01/app/oracle/product/9.2.0.6
ORACLE_HOME=/ORACLE/u01/app/oracle/product/9.2.0.6
ORACLE_PATH=/ORACLE/u01/app/oracle/product/9.2.0.6/bin::/opt/bin:/usr/bin:/GNU/b
in/make
ORACLE_SID=DBKSCZ
ORACLE_TERM=vt100
ORAENV_ASK=YES
ORATAB
ORA_CSM_MODE=line
ORA_NLS33=/ORACLE/u01/app/oracle/product/9.2.0.6/ocommon/nls/admin/data
PATH=.:/usr/local/bin:/ORACLE/u01/app/oracle/product/9.2.0.6/bin:/ORACLE/u01/app
/oracle/utn:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin
:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/o
pt/resmon/bin:/usr/sbin/stm/uut/bin/progs:/opt/pred/bin:/opt/hparray/bin:/opt/pe
rf/bin:/opt/ignite/bin:/opt/OV/bin/OpC:.:/usr/local/bin
PPID=12312
PS1='
oracle@kspxcz [ $ORACLE_SID ] [ $PWD ]
$ '
PS2='> '
PS3='#? '
PS4='+ '
PWD=/ORACLE/home/oracle
RANDOM=20906
SECONDS=577
SHELL=/usr/bin/sh
SHLIB_PATH=/ORACLE/u01/app/oracle/product/9.2.0.6/lib:/opt/cics/lib:/opt/dceloca
l/lib:/usr/lib
SID=DBKSCZ
TERM=xterm
TMOUT=0
TNS_ADMIN=/ORACLE/u01/app/oracle/admin/DBKSCZ/network/admin
TZ=MET-1METDST
_=set


env.out=

_=/usr/bin/env
MANPATH=/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/u
sr/local/man/%L:/usr/local/man:/opt/upgrade/share/man/%L:/opt/upgrade/share/man:
/usr/dt/share/man:/opt/pd/share/man/%L:/opt/pd/share/man:/opt/ignite/share/man/%
L:/opt/ignite/share/man:/opt/samba/man:/opt/resmon/share/man:/opt/pred/share/man
/%L:/opt/pred/share/man:/opt/hparray/share/man/%L:/opt/hparray/share/man:/opt/pe
rf/man/%L:/opt/perf/man:/opt/OV/man/itose/%L:/opt/OV/man/itose:/opt/ssh/share/ma
n
SHLIB_PATH=/ORACLE/u01/app/oracle/product/9.2.0.6/lib:/opt/cics/lib:/opt/dceloca
l/lib:/usr/lib
PATH=.:/usr/local/bin:/ORACLE/u01/app/oracle/product/9.2.0.6/bin:/ORACLE/u01/app
/oracle/utn:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin
:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/o
pt/resmon/bin:/usr/sbin/stm/uut/bin/progs:/opt/pred/bin:/opt/hparray/bin:/opt/pe
rf/bin:/opt/ignite/bin:/opt/OV/bin/OpC:.:/usr/local/bin
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
COLUMNS=80
ORACLE_BASE=/ORACLE/u01/app/oracle
ORACLE_PATH=/ORACLE/u01/app/oracle/product/9.2.0.6/bin::/opt/bin:/usr/bin:/GNU/b
in/make
EDITOR=vi
HISTFILE=/ORACLE/home/oracle/.hist_file.pts0
LOGNAME=oracle
ORACLE_SID=DBKSCZ
ERASE=^H
PS1=
oracle@kspxcz [ $ORACLE_SID ] [ $PWD ]
$
ORA_CSM_MODE=line
OBK_HOME=/ORACLE/u01/app/oracle/product/9.2.0.6
ORACLE_DOC=/ORACLE/u01/app/oracle/product/9.2.0.6
TNS_ADMIN=/ORACLE/u01/app/oracle/admin/DBKSCZ/network/admin
SHELL=/usr/bin/sh
ORACLE_TERM=vt100
HISTSIZE=1024
ORA_NLS33=/ORACLE/u01/app/oracle/product/9.2.0.6/ocommon/nls/admin/data
HOME=/ORACLE/home/oracle
TERM=xterm
LD_LIBRARY_PATH=/ORACLE/u01/app/oracle/product/9.2.0.6/lib:/usr/dt/lib
ORACLE_HOME=/ORACLE/u01/app/oracle/product/9.2.0.6
PWD=/ORACLE/home/oracle
LINES=43


and the echo $TZ returns

oracle@kspxcz [ DBKSCZ ] [ /ORACLE/home/oracle ]
$ echo $TZ
MET-1METDST

thx for your help!
harry d brown jr
Honored Contributor

Re: Problems with Timezone

This user

oracle@kspxcz [ DBKSCZ ] [ /ORACLE/home/oracle ]

IS using MET-1METDST:

$ echo $TZ
MET-1METDST

Which user is getting EDT ??

live free or die
harry d brown jr
Live Free or Die

Re: Problems with Timezone

oracle@kspxcz [ DBKSCZ ] [ /ORACLE/home/oracle ]
$ echo $TZ
MET-1METDST

oracle@kspxcz [ DBKSCZ ] [ /ORACLE/home/oracle ]
$ date
Mon Jun 20 07:47:43 EDT 2005

the oracle user has the problem, the output of date command shows it...

regards
harry d brown jr
Honored Contributor

Re: Problems with Timezone

What's the output of:

cat /etc/default/tz

live free or die
harry d brown jr
Live Free or Die

Re: Problems with Timezone

there is no /etc/default/tz on the system...
harry d brown jr
Honored Contributor

Re: Problems with Timezone

What does the command

locale

return?

live free or die
harry d brown jr
Live Free or Die

Re: Problems with Timezone

$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=

as root it returns the same.
harry d brown jr
Honored Contributor

Re: Problems with Timezone

From "man timezone":

1) if the environment variable TZ is present, it takes precedence.

2) if TZ is not present, then the value contained in /etc/default/tz is used for the default.

3) if /etc/default/tz is not set then the default value is equivalent to EST5EDT (Eastern Standard Time) of the USA.

/etc/default/tz can be modified for an appropriate default value for timezone.


Does "grep MET /usr/lib/tztab" return this:


[root@vpart1 /]# grep MET /usr/lib/tztab
MET-1METDST
0 3 25-31 3 1983-2038 0 METDST-2
0 2 24-30 9 1983-1995 0 MET-1
0 2 25-31 10 1996-2038 0 MET-1
[root@vpart1 /]#

live free or die
harry d brown jr
Live Free or Die

Re: Problems with Timezone

Thx for the cut of manpage... The grep returns the same as your output. But now i`ve created an /etc/default/tz with MET-1METDST in it. Now it works.

Why does it not works without it? Maybe i have to check the file permissions?
harry d brown jr
Honored Contributor

Re: Problems with Timezone


Is your machine patched to at least the Patch Bundle: http://www1.itrc.hp.com/service/patch/releasePage.do?BC=patch.breadcrumb.main|patch.breadcrumb.bundle|patch.breadcrumb.releaseIndexPage|&releaseId=5013-2091


live free or die
harry d brown jr
Live Free or Die

Re: Problems with Timezone

No it isn`t. But I will do that at the next downtime!

Thank you very much for help! :-)

Regards,

Frank
Bill Hassell
Honored Contributor
Solution

Re: Problems with Timezone

There appears to be a problem in TZ referencing the tztab file. What are the permissions on /usr /usr/lib and /usr/lib/tztab? They should look like this:

# ll -d /usr /usr/lib /usr/lib/tztab
dr-xr-xr-x 25 bin bin 8192 Oct 24 2003 /usr/
dr-xr-xr-x 39 bin bin 16384 May 30 14:45 /usr/lib/
-r--r--r-- 1 bin bin 12794 Nov 14 2000 /usr/lib/tztab

Another way to test is to specify a different TZ value on the command line:

TZ=MST7MDT date
Mon Jun 20 08:41:02 MDT 2005

TZ=PST8PDT date
Mon Jun 20 07:41:37 PDT 2005

These should each produce different times with the chosen timezone shown at the end. If you see EDT for all of these, access to the tztab file may be disabled or TZ was never exported for subprocesses.

And that may the problem: your shell's set command reports on the local variables, but env reports on exported variables. TZ is not there. Find where TZ is set for this user. It should always be set in /etc/profile as:

. /etc/TIMEZONE

VERY IMPORTANT: there is a dot (period) in front of the TIMEZONE shell script. This makes sure that the current shell runs the script and not a subshell. Without the dot, a subshell runs the script, the setting is made and then the subshell goes away and the setting in the local shell (including export) is never made.


Bill Hassell, sysadmin

Re: Problems with Timezone

Hello Bill,

the permissions on the files are set as shown from the output of your post.

I wondering why, it is now so easy! In /etc/TIMEZONE there is no export TZ. There was only TZ=MET-1METDST was in there.

Now my problem is solved... thx! :-)))