02-13-2012 04:18 PM - edited 02-13-2012 04:20 PM
ls of ftp and system ls show diffent timestamp
Basically ls of ftp show the UTC timestamp, whereas the ls of the server show PST time. I have the /etc/TIMEZONE in the PST format and my /etc/profile also read from /etc/TIMEZONE then why the javaapplet and ftp (firefox, filezilla, reflection web) show files in UTC timestamp? I want them to show in the PST zone.
HP-UX hpsrv1 B.11.11 U 9000/800 587730578 unlimited-user license
# date -u
Tue Feb 14 00:13:29 UTC 2012
Mon Feb 13 16:13:44 PST 2012
# cat /etc/TIMEZONE
02-13-2012 09:52 PM
> Basically [...]
As usual, showing actual commands with their actual output can be
more helpful than vague descriptions or interpretations.
> [...] ls of ftp show the UTC timestamp, [...]
Are you talking about the date-time values shown in a DIR/LIST
listing produced by the FTP server (which?) on your HP-UX system?
> [...] and my /etc/profile also read from /etc/TIMEZONE then why the
> javaapplet and ftp (firefox, filezilla, reflection web) show files in
> UTC timestamp?
FTP clients tend to show the data sent by the FTP server.
> #echo $TZ
The FTP server process probably cares more about what's in _its_
environment than it does about what's in _your_ environment.
I don't know where the FTP server gets its environment, and I haven't
tried this, so I know nothing, but if I wished to control its
environment, I'd probably start by writing a shell script which sets the
environment variables as I wished, and then runs the FTP server program.
Then, I'd replace the original FTP server command ("/usr/bin/ftpd ..."?)
in my inetd configuration file ("/etc/inetd.conf"?) with a similar
command which specifies my new script, instead. (Naturally, the script
should pass its command-line arguments along to the actual FTP server
02-14-2012 10:19 AM - edited 02-14-2012 11:00 AM
The ftpd daemon is run by inetd so the timezone (variable TZ) for ftpd is the one used to start inetd. inetd is started during the rc script sequence. /etc/TIMEZONE is called as part of the environment setup (/sbin/rc, /etc/rc.config and auto_parms). Something prior to inetd startup may have unset TZ or assigned it the UTC value. If you don't want to troubleshoot the startup scripts, just add the line:
at the beginnng of the /sbin/init.d/inetd script. Note carefully: there is a period, then space, then the TIMEZONE filename. This is called sourcing the file and will set TZ before inetd starts.
Once you change the /sbin/init.d/inetd script, restart inetd like this:
/sbin/init.d/inetd stop /sbin/init.d/inetd start
And now your ftp listings will be shown in the current /etc/TIMEZONE value.