Sponsored Content
Top Forums UNIX for Dummies Questions & Answers DST did not take effect on 3 Linux servers Post 302299850 by Perderabo on Saturday 21st of March 2009 05:46:28 PM
Old 03-21-2009
There is an internal system clock which is the number of seconds since the epoch and this does not get adjusted for DST. Is is right? Compare the output on a broken and working system of:
perl -e 'print time(), "\n" '

If both systems agree of the second but disagree on the representation, then one must not be patched properly or the systems are set to use different rules. That is controlled by /etc/localtime or maybe the TZ environment variable. Is that the same on both systems? Note that if your systems were up and running during the DST transition, the seconds as returned by that perl command would not suddenly change by one hour. What should change is that a different rule would now come into play about how to display the time in human readable form.

If the seconds on the internal system clock is off, then you need to look at how the system clock is set on both systems. This is the issue that your other source was probably thinking about. At boot time the system clock is initialized from the hardware clock that runs all the time via battery. You can keep in local time if you want, but it must be adjusted for DST. Linux can be set to read it and accept it. This works well when you have two OS's on the same box. Linux assumes the other OS set the clock. But for your hardware clock to cause a problem, you would need to reboot the server so it rereads the hardware clock. Or you would need to to be explicitly reading the hardware clock somehow. If linux is the only os on the box, the hardware clock really should be set to UTC (incorrectly aka GMT).

You could also be using NTP. Are you? If so, very early in the startup scripts you should get the time from an NTP server. Then the time on the hardware clock should irrelevant since it is quickly overwritten. In this case, you have an NTP problem somehow.

Be sure to read: https://www.unix.com/tips-tutorials/3...mekeeping.html

Doesn't redhat have a dateconfig (or maybe date-config) tool? If you have that, compare the settings on both systems. Otherwise check /etc/sysconfig/clock on both systems.
 

10 More Discussions You Might Find Interesting

1. Cybersecurity

Who uses Antivirus software on your linux servers?

So who uses antivirus software on your linux servers? A co-worker and myself have been debating on the need or lack there of for antivirus on a linux webserver running Apache even if that's the only service that may be running. He thinks no and I am of the opinion that it is needed. My rational... (1 Reply)
Discussion started by: jjvaas
1 Replies

2. UNIX for Dummies Questions & Answers

monitering servers in linux

how can i moniter the servers (e.g FTP, NNTP, APACHE) in linux. (4 Replies)
Discussion started by: perleo
4 Replies

3. Gentoo

What do you use on your linux servers?

What do you use on your linux servers? What distributions? (10 Replies)
Discussion started by: DCrystal
10 Replies

4. What is on Your Mind?

Microsoft servers Vs. Unix/Linux

What you have to say about the following comparison: Compare (2 Replies)
Discussion started by: tayyabq8
2 Replies

5. UNIX for Dummies Questions & Answers

Fax Servers for Linux/AIX

At the company where I work, use a product called VSI-FAX. It works nicely, but the maintenance has proven to be very poor grade. So, I'm interested in any experiences using other fax servers that run on Linux or AIX and what issues/gotchas were run into and overcome and how. I'm considering... (0 Replies)
Discussion started by: kpearson
0 Replies

6. Linux

Few Questions on about Linux Servers.

1.On x86 Machines ( Pentium4 ), What is the maximum number of Services( sshd, ntpd,named ,samba, etc.) that can be installed.? Is there a rule of thumb to attain the best possible performence.? 2. Is there a systematic way to boot a remote Machine.? 3. Are there any problems of having two... (2 Replies)
Discussion started by: kanata
2 Replies

7. UNIX for Dummies Questions & Answers

SSH into multiple linux servers

Hi All, Okay, I need help. I need to ssh in to multiple linux servers execute certain commands and get them to email and print on the screen when the script is being executed. So below is my script. Its not working :-(. #!/bin/bash #linux/UNIX box with ssh key based login... (7 Replies)
Discussion started by: xytiz
7 Replies

8. Linux

How to check CFG2HTML for Linux servers?

Hi, Could someone please let me know how to How to check CFG2HTML for Linux servers? I am new for OS end. Thanks, Vivek. (4 Replies)
Discussion started by: Viv_kadam
4 Replies

9. Shell Programming and Scripting

Script to locating Linux servers

All, Need an urgent help! , I have an simple text file that holding more than 500 IP Address, My requirement : bash script that will run from my central server , and will scan with nmap all the 500 ip address , for ssh port with . for example with the command : nmap -sT | grep '22.*open' ... (1 Reply)
Discussion started by: James Stone
1 Replies

10. Linux

How does Linux handle DST ( daylight saving time)?

Hello Can sombody please tell me how linux handles DST ( daylight saving time) ? Does the time change instantly , ex: if is is 3'o clock does linux instantly swich to 2'o clock ? plese give more info about this toppic (2 Replies)
Discussion started by: martonlorand
2 Replies
GETTIMEOFDAY(2) 					     Linux Programmer's Manual						   GETTIMEOFDAY(2)

NAME
gettimeofday, settimeofday - get / set time SYNOPSIS
#include <sys/time.h> int gettimeofday(struct timeval *tv, struct timezone *tz); int settimeofday(const struct timeval *tv, const struct timezone *tz); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): settimeofday(): _BSD_SOURCE DESCRIPTION
The functions gettimeofday() and settimeofday() can get and set the time as well as a timezone. The tv argument is a struct timeval (as specified in <sys/time.h>): struct timeval { time_t tv_sec; /* seconds */ suseconds_t tv_usec; /* microseconds */ }; and gives the number of seconds and microseconds since the Epoch (see time(2)). The tz argument is a struct timezone: struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ int tz_dsttime; /* type of DST correction */ }; If either tv or tz is NULL, the corresponding structure is not set or returned. (However, compilation warnings will result if tv is NULL.) The use of the timezone structure is obsolete; the tz argument should normally be specified as NULL. (See NOTES below.) Under Linux there are some peculiar "warp clock" semantics associated with the settimeofday() system call if on the very first call (after booting) that has a non-NULL tz argument, the tv argument is NULL and the tz_minuteswest field is nonzero. (The tz_dsttime field should be zero for this case.) In such a case it is assumed that the CMOS clock is on local time, and that it has to be incremented by this amount to get UTC system time. No doubt it is a bad idea to use this feature. RETURN VALUE
gettimeofday() and settimeofday() return 0 for success, or -1 for failure (in which case errno is set appropriately). ERRORS
EFAULT One of tv or tz pointed outside the accessible address space. EINVAL Timezone (or something else) is invalid. EPERM The calling process has insufficient privilege to call settimeofday(); under Linux the CAP_SYS_TIME capability is required. CONFORMING TO
SVr4, 4.3BSD. POSIX.1-2001 describes gettimeofday() but not settimeofday(). POSIX.1-2008 marks gettimeofday() as obsolete, recommending the use of clock_gettime(2) instead. NOTES
The time returned by gettimeofday() is affected by discontinuous jumps in the system time (e.g., if the system administrator manually changes the system time). If you need a monotonically increasing clock, see clock_gettime(2). Macros for operating on timeval structures are described in timeradd(3). Traditionally, the fields of struct timeval were of type long. The tz_dsttime field has never been used under Linux. Thus, the following is purely of historic interest. On old systems, the field tz_dsttime contains a symbolic constant (values are given below) that indicates in which part of the year Day- light Saving Time is in force. (Note: this value is constant throughout the year: it does not indicate that DST is in force, it just selects an algorithm.) The daylight saving time algorithms defined are as follows: DST_NONE /* not on DST */ DST_USA /* USA style DST */ DST_AUST /* Australian style DST */ DST_WET /* Western European DST */ DST_MET /* Middle European DST */ DST_EET /* Eastern European DST */ DST_CAN /* Canada */ DST_GB /* Great Britain and Eire */ DST_RUM /* Romania */ DST_TUR /* Turkey */ DST_AUSTALT /* Australian style with shift in 1986 */ Of course it turned out that the period in which Daylight Saving Time is in force cannot be given by a simple algorithm, one per country; indeed, this period is determined by unpredictable political decisions. So this method of representing timezones has been abandoned. SEE ALSO
date(1), adjtimex(2), clock_gettime(2), time(2), ctime(3), ftime(3), timeradd(3), capabilities(7), time(7) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2012-04-26 GETTIMEOFDAY(2)
All times are GMT -4. The time now is 05:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy