Clock won't keep setting after reboot(Solved)

Non release banter
fi5ban
White ninja
White ninja
Posts: 15
Joined: 23 Oct 2013, 20:02
Distribution: latest
Location: Nebraska,USA

Clock won't keep setting after reboot(Solved)

Post#1 by fi5ban » 03 Nov 2013, 23:10

Hi All

New to portues but am an avid lover of it already!!! Now just trying to decide between XFCE and Razor Like the over all operation and feel of Razor>

I have came across an issue with time setting when I go into porues setting and set it to local machine it changes but when I reboot it goes back to UTC setting.

I tried to do download and install a fresh basic load same problem.

XFCE seems ok and so did mate

Thanks
Last edited by fi5ban on 18 Feb 2014, 03:56, edited 1 time in total.

User avatar
wread
Module Guard
Module Guard
Posts: 1255
Joined: 09 Jan 2011, 18:48
Distribution: Porteus v5.0-kde-64 bits
Location: Santo Domingo
Contact:

Re: Clock won't keep setting after reboot

Post#2 by wread » 04 Nov 2013, 01:03

After setting time as you wish, copy /etc/localtime to rootcopy/etc/localtime and that's it!

Regards!
Porteus is proud of the FASTEST KDE ever made.....(take akonadi, nepomuk and soprano out and you will have a decent OS).
The Porteus Community never sleeps!

fi5ban
White ninja
White ninja
Posts: 15
Joined: 23 Oct 2013, 20:02
Distribution: latest
Location: Nebraska,USA

Re: Clock won't keep setting after reboot

Post#3 by fi5ban » 04 Nov 2013, 03:02

great will do that thanks!!

question thought why does it work ok in xfce with out creating that in rootcopy??

again thanks for all the work the team is doing

fi5ban
White ninja
White ninja
Posts: 15
Joined: 23 Oct 2013, 20:02
Distribution: latest
Location: Nebraska,USA

Re: Clock won't keep setting after reboot

Post#4 by fi5ban » 04 Nov 2013, 04:43

OK see if I can write this and make since?!

Thanks for pointing out that location. I went to check it out and that localtime file was not in /etc there was a file localtime-copied-from.
and it pointed to in usr/shared/timezone. I looked there, and saw localtime which said missing a link to /etc/localtime. i copied it over and now all is fine so far

not sure where file came from said something in regards to factory???



After setting time as you wish, copy /etc/localtime to rootcopy/etc/localtime and that's it!

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Clock won't keep setting after reboot

Post#5 by brokenman » 05 Nov 2013, 12:56

The time setting in the settings center is desktop independent. It shouldn't matter which desktop you run it in, it does the same job.
How do i become super user?
Wear your underpants on the outside and put on a cape.

fi5ban
White ninja
White ninja
Posts: 15
Joined: 23 Oct 2013, 20:02
Distribution: latest
Location: Nebraska,USA

Re: Clock won't keep setting after reboot (SOLVED)

Post#6 by fi5ban » 06 Nov 2013, 15:54

I figured out my clock issue.
When I created my ISO instead of taking factory setting I choose a time zone (America/Chicago) so even when went in to porteus configure time zone it would revert back to that on a reboot.
(when booted from cd was the wrong time also)

went and created a new ISO with factory and seems be working fine now(even when boot from cd time is correct)

this seems true across all desktops.

Thanks Brokenman for pointing that out it help me find my problem (I think) :Yahoo!:

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Clock won't keep setting after reboot

Post#7 by brokenman » 06 Nov 2013, 22:38

Excellent.
When I created my ISO instead of taking factory setting I choose a time zone (America/Chicago)
I still think this is an issue. You did what anyone would have done in the wizard. You chose a timezone specific to where you are located ( I imagine) and you expect that the system clock would be updated to reflect that. We need to work on this. I think Ahau has finally found a suitable solution and it will be implemented in the next release.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Clock won't keep setting after reboot

Post#8 by Ahau » 06 Nov 2013, 23:24

Yes, I believe I've figured it out, we just have to find the best way to implement it, and I've not really thought about how to integrate it into the wizard. It's easy enough to pick your timezone, I imagine the majority of people know what timezone they are in, but we'll also need to build in a choice for having your hardware clock being set to UTC vs localtime, and that concept is a little more difficult to grasp. I want to make it accessible without being overly wordy (but I love my words!! :oops: ). Maybe:

x localtime (common for Windows machines - your BIOS clock matches your local time)
x UTC (used more on non-Windows machines - your BIOS clock matches Greenwich Mean Time and needs to be offset for your timezone).

Bleh, already too many words!

The problem is that if you choose a timezone (other than Factory, UTC, or GMT) and you have a localtime hardware clock, your time is going to be offset incorrectly. Seeing now how all this works and the way the wizard is set up, I imagine a number of people have experienced this - :oops: - my apologies!
Please take a look at our online documentation, here. Suggestions are welcome!

donald
Full of knowledge
Full of knowledge
Posts: 2065
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: Clock won't keep setting after reboot

Post#9 by donald » 06 Nov 2013, 23:31

maybe it's not bad to remove the "choose timezone" option from the build-wizard
so the default is always localtime.
A user can choose the timezone later in PSC.
(should be done without changing the real Hw-clock)
If the system-clock (Hw/bios) will be automatically updated by Porteus (in next release?,by default?)
then I see new problems arise if you have a dual-boot system.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Clock won't keep setting after reboot

Post#10 by Ahau » 07 Nov 2013, 06:20

Thanks donald -- I agree, I think we should either eliminate the timezone option from the build wizard or leave it there, change the default to be timezone+localtime, with a checkbox below it that says something like: "My hardware clock is set to UTC (if you aren't sure, leave this unchecked)."

The way I've gotten it to work now, using localtime with a timezone won't cause the hardware clock to get messed up for future boots or other operating systems. This was why I suggested avoiding it previously, but now that we see some applications need the correct local timezone to function properly, I dug a little deeper to find out what was going on.

When I looked at this issue before, this was the behavior I saw:
1) Log in to fresh system - time is 10am on hardware clock and system
2) Use Slackware's 'timeconfig' script to set clock to 'localtime' and 'US/Pacific' timezone
3) System clock now reads 2am
4) say "wtf?" and reboot without saved changes
5) now I'm back in fresh system, and the time is 2am on my hardware clock and the system!

Now, if you select UTC, instead of localtime, everything appears to work as one would expect - the time gets offset (as it should) and nothing changes on a reboot. I made the faulty assumption that using localtime with a timezone other than "factory" wasn't really the way to go.

As I looked deeper more recently, I finally realized that this is what's going on (looking at a script from Puppy really helped me put the last pieces together).
1) When you start up the system, it sets the system clock from the hardware clock. Hardware clock=10am, system=10am with localtime setting
2) Run timeconfig and set to localtime and US/Pacific. Hardware clock=10am, system clock=2am.
3) When you shut down the system, it sets the hardware clock from the system clock. Hardware clock=2am, system clock=2am
4) Reboot, and system clock once again gets set from the hardware clock, which just lost 8 hours.

What should have been taking place (immediately after step 2) is another setting of the system clock from the hardware clock, which takes account for the correct time shift. This brings the system clock back to 10am so when the system shuts down, it doesn't affect the hardware clock. I've posted an updated version of the gtk-porteus-timeconfig utility for testing, the link is in this post: http://forum.porteus.org/viewtopic.php? ... =15#p19217

Hopefully this will get us all straightened out on the issue :)
Please take a look at our online documentation, here. Suggestions are welcome!

dstruct2k
Ronin
Ronin
Posts: 3
Joined: 18 Mar 2014, 14:41
Distribution: NT
Location: Winnipeg

Re: Clock won't keep setting after reboot

Post#11 by dstruct2k » 18 Mar 2014, 14:44

Ahau wrote:Yes, I believe I've figured it out, we just have to find the best way to implement it, and I've not really thought about how to integrate it into the wizard. It's easy enough to pick your timezone, I imagine the majority of people know what timezone they are in, but we'll also need to build in a choice for having your hardware clock being set to UTC vs localtime, and that concept is a little more difficult to grasp. I want to make it accessible without being overly wordy (but I love my words!! :oops: ). Maybe:

x localtime (common for Windows machines - your BIOS clock matches your local time)
x UTC (used more on non-Windows machines - your BIOS clock matches Greenwich Mean Time and needs to be offset for your timezone).

Bleh, already too many words!

The problem is that if you choose a timezone (other than Factory, UTC, or GMT) and you have a localtime hardware clock, your time is going to be offset incorrectly. Seeing now how all this works and the way the wizard is set up, I imagine a number of people have experienced this - :oops: - my apologies!
Forgive me if I'm wrong, but couldn't Porteus just contact a timeserver and compare the offset to the offset defined in the ISO to make this determination automatically? And if all 3 sources (the ISO, the RTC, and the remote server) all match up with UTC time, pop up a simple timezone picker on first boot? Seems like that would be a solution for >90% of cases.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Clock won't keep setting after reboot(Solved)

Post#12 by brokenman » 18 Mar 2014, 23:12

Unfortunately this wouldn't work in the case of non writeable media and people who boot in always fresh mode. In this case EVERY boot is the first boot and a popup becomes annoying. Also many users may be a little disconcerted by something dialing out upon boot.
How do i become super user?
Wear your underpants on the outside and put on a cape.

mdavies5
White ninja
White ninja
Posts: 12
Joined: 09 Aug 2014, 02:17
Distribution: 3.2
Location: Australia

Re: Clock won't keep setting after reboot(Solved)

Post#13 by mdavies5 » 10 Aug 2014, 03:01

I'm not sure why this is marked as solved. I have V3.01 with RazorQt. During the build I set the options to "my system clock is set to local time" and the timezone to Melbourne/Australia (UTC + 10). The file /etc/localtime contains the correct code "TZif2" and I also copied this to /rootcopy/etc as advised in earlier post.
When I boot the time displayed is UTC. When I go to the Settings Centre and check the time setting it reflects the build choice. If I change the "system clock" option to UTC then my display clock corrects itself after a few seconds. After logging out and in, the clock is still correct. If I reboot then the display clock resets to UTC and the time-config resets the system clock to "local time".
I understand that the timezone is stored in /etc/localtime but where is the system clock setting stored? If it stayed on UTC when I rebooted then the time would be correct. It is illogical but at that wouldn't bother me.
I have played with the UTC setting in /home/michael/.config/razor/panel.conf but this only changes the display widget. I also notice there are some time settings in /home/michael/.config/razor/razor-confupdate.conf; are these relevant?

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Clock won't keep setting after reboot(Solved)

Post#14 by brokenman » 10 Aug 2014, 21:16

When you first boot, the system clock is set from the hardware clock (CMOS) in /etc/rc.d/rc.S via hwclock. hwclock assumes the hardware clock is set to localtime unless UTC is found in the file /etc/hardwareclock in which case it is run with the --utc switch.

Code: Select all

# Set the system time from the hardware clock.
# Check for a broken motherboard RTC clock (where ioports for rtc are
# unknown) to prevent hwclock causing a hang:
grep -qw rtc /proc/ioports || CLOCK_OPT="--directisa"
if grep -qw "^UTC" /etc/hardwareclock; then
    hwclock $CLOCK_OPT --utc -s &
else
    hwclock $CLOCK_OPT --localtime -s &
fi
The system clock is set by whatever is in /etc/locatime. If you are in Melbourne/Australia then you should make symlinks:

Code: Select all

ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
ln -s /usr/share/zoneinfo /usr/lib/zoneinfo
The latter is to accommodate older applications that may still look in this path.

Hopefully this is what the time application is doing. I will check it out tomorrow. During shutdown the system time is usually written back to the hardware clock but I believe this has been removed (fanthom can confirm). I normally set the system clock, and then set the hardware clock to the system clock with:

Code: Select all

/sbin/hwclock --systohc
How do i become super user?
Wear your underpants on the outside and put on a cape.

mdavies5
White ninja
White ninja
Posts: 12
Joined: 09 Aug 2014, 02:17
Distribution: 3.2
Location: Australia

Re: Clock won't keep setting after reboot(Solved)

Post#15 by mdavies5 » 11 Aug 2014, 03:44

Thanks brokenman,
fanthom actually gave me the solution "edit /boot/syslinux/porteus.cfg to 'Australia/Melbourne utc' " but your answer made it possible for me to pinpoint the problem.
My /etc/localtime has never been a problem but I was unaware of /etc/hardwareclock and /etc/rc.d/rc.s so here is what I did.
I removed 'utc' from porteus.cfg. I made sure hardwareclock included 'UTC' and I rebooted. I then checked hardwareclock and found it was set to 'localtime'. The time stamp on the file indicated it was changed during reboot. I then checked rc.s and found that the hardware clock is being set based on the cheat code 'utc' if it is present. It is not being based on the setting in the hardwareclock file.
Surely if the user preferences are being stored in hardwareclock then they should be read from this file during boot not being overwritten? I will leave it to you experts because my forte is Java not bash.
I hope my comments help
Regards
Mike

Post Reply