Operating System - HP-UX
1753814 Members
7852 Online
108805 Solutions
New Discussion юеВ

Re: ftp server displays incorrect timestamp

 
John Carver
Frequent Advisor

ftp server displays incorrect timestamp

I have an HPUX11.23 box that displays the file timestamp incorrectly from a windows ftp client and a hpux ftp client. On the server itself the date command displays the correct date, the timezone appears to be set correctly, ntp is working fine but both ftp clients display the file timestamp exactly 7 hours ahead of the correct time. This appears to be related to the timezone, but how? My other hpux servers display the correct timestamps when the same ftp clients connect to them.
11 REPLIES 11
Tingli
Esteemed Contributor

Re: ftp server displays incorrect timestamp

I don't know the exact cause for this problem. But I guess that there might be something to do the permission for the time zone setting which is unreadable to ftp. Thus, it puts the time zone to GMT.
Steven Schweda
Honored Contributor

Re: ftp server displays incorrect timestamp

A Forum search for keywords like
ftp timezone
found many potentially useful things. One
example:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=138820

As usual, a more complete problem description
might help. Are you using anonymous FTP, or
FTP as some particular user(s)? (What
happens when you try the other one?)
Dennis Handly
Acclaimed Contributor

Re: ftp server displays incorrect timestamp

I hope that "date -u" displays the right date too?
Tingli
Esteemed Contributor

Re: ftp server displays incorrect timestamp

Also, if the date result is different between root and common users, then more possible the permission issue.
Bill Hassell
Honored Contributor

Re: ftp server displays incorrect timestamp

> exactly 7 hours

Yep, the TZ variable is not been set for ftpd. The ftpd daemon is started by rc scripts so if ftpd is wrong, most everything in inetd.conf is probably using the wrong TZ value. There should be only ONE location to set the timezone: /etc/TIMEZONE. This file is read by all the rc startup scripts. You can't use your local login to porve the time is correct unless you bypass TZ and use date -u. Occasionally, misinformed sysadmins will set TZ manually in .profile.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: ftp server displays incorrect timestamp

>Bill: misinformed sysadmins will set TZ manually in .profile.

Did you mean /etc/profile?
Or did you mean they change that file and not /etc/TIMEZONE?
Bill Hassell
Honored Contributor

Re: ftp server displays incorrect timestamp

> Dennis: /etc/profile

Yes, manually setting TZ in /etc/profile or even setting it in the skeleton .profile, not knowing that there is a system-wide file to source a standard TZ value. For users in other timezones, a manual setting in .profile can be useful.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: ftp server displays incorrect timestamp

>Bill: For users in other timezones, a manual setting in .profile can be useful.

Thanks, I wanted to make sure this was said.
Steven Schweda
Honored Contributor

Re: ftp server displays incorrect timestamp

I haven't tried it, but I'd expect that one
could set a time zone for the FTP server by
specifying an appropriate wrapper script in
inetd.conf instead of the actual ftpd
program.