LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-08-2015, 07:55 AM   #1
xj25vm
Member
 
Registered: Jun 2008
Posts: 393

Rep: Reputation: 68
Keeping the kernel TZ up to date in Slackware without rebooting


You will have to <strikethrough>bare</strikethrough> bear with me on this one as I'm not entirely sure I understand it. Based on my reading so far, when (any) Linux boots up, it takes the time from an external source (such as a CMOS/BIOS clock), applies the localtime offset to it and it passes this to the kernel so the kernel has it's own time. Also, based on what I've read, it would seem that many Linux distros (Slackware included) don't take care of updating the kernel timezone offset automatically (without reboot) when the DST kicks in.

If correct, this appears to be causing problems on one of my servers where I use a time based iptables rule. Iptables appears to be using the kernel time - and every time we change to DST, iptables is one hour out until I reboot the machine. If I check the date/time from the command line, this is correct though even before I reboot - so it looks it is just the kernel that gets stuck on the old offset until reboot.

If all the above is correct - would it be possible for Slackware to take care of updating the kernel TZ automatically when DST kicks in - so that iptables works correctly and doesn't need a server reboot every time? After all, Linux is famous for not needing reboots - and all other software on the machine seems to cope fine with the new time automatically.

I have my hardware clock set to UTC.

Then again, I could be wrong about some of the above?

Edit: OK - a bit more head scratching, and it would seem that iptables uses now UTC by default - and --kerneltz is discouraged (mainly because of the above issues). So I modified my rc.firewall to translate the times I want from local time to utc (as the desired times are always in local time) and feed them to the iptables commands, and then also set a cronjob to restart the firewall at the weekend - which should fix things automatically when there is a DST change at the weekend.

However, the kerneltz will still be stuck on the old offset until a reboot - but I guess that is not my problem any more :-)

Last edited by xj25vm; 04-08-2015 at 09:57 AM. Reason: Spelling fixed as per Alien Bob's suggestion
 
Old 04-08-2015, 09:08 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
I won't go "bare" with you, yuck. You probably meant "bear with me"?
 
Old 04-08-2015, 09:58 AM   #3
xj25vm
Member
 
Registered: Jun 2008
Posts: 393

Original Poster
Rep: Reputation: 68
Thanks Eric - I've edited now the original post. Any chance of an IT slanted comment
 
Old 04-08-2015, 12:31 PM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,896

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
hwclock --systz ?

... but I doubt anything is going to be referencing the kernel tz structure anyway, it was obsoleted long ago, and never really worked propperly even when it wasn't.
 
Old 04-08-2015, 03:00 PM   #5
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,770

Rep: Reputation: 1455Reputation: 1455Reputation: 1455Reputation: 1455Reputation: 1455Reputation: 1455Reputation: 1455Reputation: 1455Reputation: 1455Reputation: 1455
setsystz utility https://lkml.org/lkml/2007/2/19/214
 
Old 04-08-2015, 04:05 PM   #6
xj25vm
Member
 
Registered: Jun 2008
Posts: 393

Original Poster
Rep: Reputation: 68
If my understanding is correct, the system TZ and the kernel TZ are separate entities. On the other hand, hwclock --hctosys sets both of them, according to the man page.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How are people keeping Slackware up to date ruario Slackware 43 04-02-2013 06:37 AM
Keeping Slackware Up-to-date Bash Rules Slackware 22 09-08-2009 10:20 PM
Keeping Slackware 12.1 up to date. glore2002 Slackware 10 06-18-2008 09:58 AM
keeping slackware 11 up-to date ronty Slackware 6 01-20-2007 08:14 AM
Keeping Slackware Up-To-Date introuble Slackware 4 03-21-2006 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration