The GUI tool to set date time works great when your running X or whatever, but what is it really doing in the background? How do I setup automatic time synchronization from the command line?
Reference the GUI setup doc at: http://www.centos.org/docs/5/html/5.1/Deployment_Guide/ch-dateconfig.html
On Thu, Feb 07, 2008 at 05:25:59PM -0800, Tim Alberts wrote:
The GUI tool to set date time works great when your running X or whatever, but what is it really doing in the background? How do I setup automatic time synchronization from the command line?
Modify the file /etc/ntp.conf and make sure ntpd is running.
On Thu, Feb 07, 2008, Tim Alberts wrote:
The GUI tool to set date time works great when your running X or whatever, but what is it really doing in the background? How do I setup automatic time synchronization from the command line?
A method I frequently use to figure out what's going on under the covers is to create a file to use as a time stamp, modify something with a GUI, then use find to see what has been changed.
touch /tmp/timestamp # do something GUIish find /etc -newer /tmp/timestamp > /tmp/changelist
Bill -- INTERNET: bill@celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
The meek shall inherit the Earth, the rest of us will go to the stars... -Dr. Isaac Asimov
I have a script that runs every night that syncs the clock and then records it to the hardware clock.
#!/bin/sh /usr/bin/rdate -s time-a.nist.gov /sbin/hwclock -w
On Thu, Feb 07, 2008 at 08:03:52PM -0600, Todd Reed wrote:
I have a script that runs every night that syncs the clock and then records it to the hardware clock.
#!/bin/sh /usr/bin/rdate -s time-a.nist.gov
That's nasty and can cause the clock to go backwards. Unix really does like the clock to only go forwards.
Use NTP, which is designed to keep the clock always in sync.
Any ideas how to force tomcat to display directory listing in local time zone format of my cent box instead of GMT.
I tried all suggestions here: http://marvinlee.wordpress.com/2008/02/01/java-timezone-setting-in-cento s-for-asiakuala_lumpur/
except I use PST8PDT for the timezone....i believe I'm using this as my timezone as this is what appears in /etc/localtime file. When using date command it displays in correct format from bash prompt.
it just seems that tomcat is ignoring it for some reason....
any help would be appreciated.
-isaac
On Feb 7, 2008 9:12 PM, Isaac Gonzalez igonzalez@autoreturn.com wrote:
Any ideas how to force tomcat to display directory listing in local time zone format of my cent box instead of GMT.
I tried all suggestions here: http://marvinlee.wordpress.com/2008/02/01/java-timezone-setting-in-cento s-for-asiakuala_lumpur/
except I use PST8PDT for the timezone....i believe I'm using this as my timezone as this is what appears in /etc/localtime file. When using date command it displays in correct format from bash prompt.
I don't know exactly what PST8PDT is, but Java prefers the full names for time zones like US/Central or US/Pacific
Have you tried something like -Duser.timezone=US/Pacific on the java command line that launches tomcat. You can add that to JAVA_OPTS in $CATALINA_HOME/bin/setenv.sh
Is your tzdata package in CentOS up to date?
Then again, I haven't done much with directory listings in Tomcat, so there may be a different issue at work here. Can you create a simple JSP page that writes java.util.TimeZone.getDefault().toString() and see what you get?
-- Jeff
I'm setting export CATALINA_OPTS= "Duser.timezone=America/Los_Angeles" in my init.d script that starts up the tomcat(haven't set it in $CATALINA_HOME/bin/setenv.sh)...but will try that as well ....i wrote a simple java function that print the date, and when I call java foo, it prints the correct date format. I haven't tried the jsp page, but will also try that...seems as if tomcat is ignoring everything I set.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Jeff Larsen Sent: Friday, February 08, 2008 8:46 AM To: CentOS mailing list Subject: Re: [CentOS] Java not seeing timezone/tomcat displaying times in GMT
On Feb 7, 2008 9:12 PM, Isaac Gonzalez igonzalez@autoreturn.com wrote:
Any ideas how to force tomcat to display directory listing in local
time
zone format of my cent box instead of GMT.
I tried all suggestions here:
http://marvinlee.wordpress.com/2008/02/01/java-timezone-setting-in-cento
s-for-asiakuala_lumpur/
except I use PST8PDT for the timezone....i believe I'm using this as
my
timezone as this is what appears in /etc/localtime file. When using
date
command it displays in correct format from bash prompt.
I don't know exactly what PST8PDT is, but Java prefers the full names for time zones like US/Central or US/Pacific
Have you tried something like -Duser.timezone=US/Pacific on the java command line that launches tomcat. You can add that to JAVA_OPTS in $CATALINA_HOME/bin/setenv.sh
Is your tzdata package in CentOS up to date?
Then again, I haven't done much with directory listings in Tomcat, so there may be a different issue at work here. Can you create a simple JSP page that writes java.util.TimeZone.getDefault().toString() and see what you get?
-- Jeff _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Feb 8, 2008 6:18 PM, Isaac Gonzalez igonzalez@autoreturn.com wrote:
I'm setting export CATALINA_OPTS= "Duser.timezone=America/Los_Angeles" in my init.d script that starts up the tomcat(haven't set it in $CATALINA_HOME/bin/setenv.sh)...but will try that as well ....i wrote a simple java function that print the date, and when I call java foo, it prints the correct date format. I haven't tried the jsp page, but will also try that...seems as if tomcat is ignoring everything I set.
This is definitely a Tomcat issue. You should take it to a Tomcat list. I can tell you what I found though:
I ran Tomcat in a debugger to locate the code that generates the directory listing text. In the Tomcat 5.5.23 source code in class org.apache.naming.resources.ResourceAttribute, the timezone for the date formatter is hard coded as GMT. Nice, huh?
Maybe there's a way to manipulate that, but I don't know it. The Tomcat developers probably don't care much about it because Tomcat is seldom used to serve static content.
But at least you can stop letting the time zone configuration drive you crazy...
-- Jeff