Operating System - HP-UX
1848591 Members
6600 Online
104033 Solutions
New Discussion

Date & "remsh server date" different results

 
SOLVED
Go to solution
Carlo Henrico_1
Regular Advisor

Date & "remsh server date" different results

Here is an interesting one. I am running HP-UX 11.0.

The "date" and "date -u" command return the correct values for time (current and current -2 , TZ=CTU-2), but when I type "remsh server_name date" it gives me one hour ahead. kmtune shows dst=0.

This one hour ahead time also gets reported to the syslog all the time too. Any jobs which run also reflect this. Any ideas please?

Carlo
(177/177)
Live fast, die young - enjoy a good looking corpse!
30 REPLIES 30
Pete Randall
Outstanding Contributor

Re: Date & "remsh server date" different results

Carlo,

Is the TZ value the same on the server you're remsh'ing from?


Pete

Pete
Carlo Henrico_1
Regular Advisor

Re: Date & "remsh server date" different results

It is the same server.

Carlo
Live fast, die young - enjoy a good looking corpse!
Fred Ruffet
Honored Contributor

Re: Date & "remsh server date" different results

also verify the TZ values for the user you're running date with, and for the one your logging into using remsh.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Fred Ruffet
Honored Contributor

Re: Date & "remsh server date" different results

Even if you are running remsh to the same server, TZ can be different for each user, and even for the system.

Every user has its TZ variable, and system has /etc/TIMEZONE. Your server can be runing in Mexico and having users connected from Sidney, and London.

So let us know what are those settings for your system, and the users you are using in your tests (the one running date, the one you remsh into, and the system file)

regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Carlo Henrico_1
Regular Advisor

Re: Date & "remsh server date" different results

There is one server.

All done as root.

The issue is not the remsh as such. To me the issue is why it is reporting time to the syslog of one hour ahead. The remsh was just to elaborate. I do not specify -l in my remsh.

Thanks

Carlo
Live fast, die young - enjoy a good looking corpse!
Fabio Ettore
Honored Contributor

Re: Date & "remsh server date" different results

Hi Carlo,

I know a similar problem which happens about LANG variable. remsh read a different value than telnet or rlogin.

Your problem is slightly different but similar because it seems that remsh reads something else.
Try this test:

on server launch:
# echo $TZ

and then on the same server:
# remsh server_name
# echo $TZ

Are two values of 'echo $TZ' different?

Best regards,
Ettore
WISH? IMPROVEMENT!
Pete Randall
Outstanding Contributor

Re: Date & "remsh server date" different results

Carlo,

Out of curiosity, what do you see if you "echo $TZ" compared to doing the same thing via remsh?


Pete

Pete
Carlo Henrico_1
Regular Advisor

Re: Date & "remsh server date" different results

The values are the same of $TZ (CTU-2) if you type echo $TZ and remsh server "echo $TZ" where server = the server I am currently logged on to.

Carlo
Live fast, die young - enjoy a good looking corpse!
Jeroen Peereboom
Honored Contributor

Re: Date & "remsh server date" different results

Typing remsh server "echo $TZ" is no good. $TZ gets substituted on the local server and then echo CTU-2 is executed on the remote server.

You should try 'echo $TZ' with '''''

JP.
Jeroen Peereboom
Honored Contributor

Re: Date & "remsh server date" different results

Carlo,

did you change your timezone recently?
Has you server been rebooted recently?
It seems some processes do not know the current value.

Jeroen P.
32/31/1 (32 replies, approx. 31 replies with assigned points, 1 time 0 points!)
Carlo Henrico_1
Regular Advisor

Re: Date & "remsh server date" different results

Jeroen

remsh server 'echo $TZ' returns different value!!!

Server been up for 90 days. Will try to organise reboot after hours.

Carlo
Live fast, die young - enjoy a good looking corpse!
RAC_1
Honored Contributor

Re: Date & "remsh server date" different results

Is /etc/TIMEZONE file present? What are the perms on it?

Do you use same user to execute date and remsh server_name date commands?

type date -- when you execute data
AND
remsh server_name "type date"

Post the results

Anil
There is no substitute to HARDWORK
Patrick Wallek
Honored Contributor

Re: Date & "remsh server date" different results

Whoa whoa! Just because a different $TZ value is returned is no reason to reboot!!!

What you need to figure out is where that particular timezone gets set. If your /etc/TIMEZONE file is different all you need to do is change it, and restart syslogd.

Pete Randall
Outstanding Contributor

Re: Date & "remsh server date" different results

Imagine that: $TZ was different!

Pete
Fred Ruffet
Honored Contributor

Re: Date & "remsh server date" different results

Don't reboot, please ! :o

could you send us output for
cat /etc/TIMEZONE...

regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Carlo Henrico_1
Regular Advisor

Re: Date & "remsh server date" different results

This is getting interesting guys...

finsysa / (root) $ remsh finsysa 'echo $TZ'
SAST-2SADT
finsysa / (root) $ echo $TZ
CTU-2
finsysa / (root) $ type date
date is a tracked alias for /bin/date
finsysa / (root) $ remsh finsysa "type date"
date is a tracked alias for /usr/bin/date
finsysa / (root) $ /usr/bin/date
Fri Jun 18 15:41:56 CTU 2004
finsysa / (root) $ /bin/date
Fri Jun 18 15:42:09 CTU 2004

Carlo
Live fast, die young - enjoy a good looking corpse!
Carlo Henrico_1
Regular Advisor

Re: Date & "remsh server date" different results

finsysa / (root) $ ll /etc/TIMEZONE
-r--r--r-- 1 bin bin 19 Apr 6 09:17 /etc/TIMEZONE
finsysa / (root) $ cat /etc/TIMEZONE
TZ=CTU-2
export TZ

Not rebooted yet, system in production!

How do I restart the syslogd?

Carlo
Live fast, die young - enjoy a good looking corpse!
Fred Ruffet
Honored Contributor

Re: Date & "remsh server date" different results

/bin must be a link to /usr/bin. difference is elapsed time for typing commands.

ll -d /bin /usr/bin should tell you.

I insist for seeing /etc/TIMEZONE :)
TZ for remsh session must be set by remshd reading from this file...

regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Carlo Henrico_1
Regular Advisor

Re: Date & "remsh server date" different results

And here some more interesting info:

finsysa / (root) $ remsh finsysa "cat /etc/TIMEZONE"
TZ=CTU-2
export TZ
finsysa / (root) $ remsh finsysa 'cat /etc/TIMEZONE'
TZ=CTU-2
export TZ

Carlo
Live fast, die young - enjoy a good looking corpse!
Fred Ruffet
Honored Contributor

Re: Date & "remsh server date" different results

kill -1 the syslogd process should work...
maybe need for inetd too.
--

"Reality is just a point of view." (P. K. D.)
RAC_1
Honored Contributor

Re: Date & "remsh server date" different results

As root

env

As root

remsh server "env"

Compare the output of both.

Anil
There is no substitute to HARDWORK
Jdamian
Respected Contributor

Re: Date & "remsh server date" different results

I think this problem is due to the ENVIRONMENT of the remshd daemon, ie, the remshd process (the parent process of your remsh session) has a different value of TZ variable.

In order to debug I suggest run the following commands above and find differences:

# env

# remsh server_name env

Carlo Henrico_1
Regular Advisor

Re: Date & "remsh server date" different results

There is a massive difference in these two files. The "env" has MANPATH etc etc etc, the "remsh server env" has very little, including the wrong timezone.

The kill -1 syslogd_pid did not help.

Carlo
Live fast, die young - enjoy a good looking corpse!
RAC_1
Honored Contributor

Re: Date & "remsh server date" different results

So wrong timezone explains the error.

you need to do.

remsh "server" "TZ=xxx;date"

Anil
There is no substitute to HARDWORK