System clock - [Solved]

Arch based Porteus community project
User avatar
Ed_P
Contributor
Contributor
Posts: 3067
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

System clock - [Solved]

Post#1 by Ed_P » 03 Dec 2015, 06:23

Whenever I boot Porteus 3.3 it sets my system's clock ahead 5 hrs. I suspect it has something to do with time zones but I can't figure out how to change that.

But even with the time zone wrong I don't think the OS should change the machine's clock without user involvement.
Last edited by Ed_P on 06 Dec 2015, 01:42, edited 3 times in total.
Ed

Igor
Black ninja
Black ninja
Posts: 51
Joined: 05 Feb 2014, 14:16
Distribution: porteus

Re: System clock

Post#2 by Igor » 03 Dec 2015, 13:25

.
Last edited by Igor on 04 Dec 2015, 16:51, edited 1 time in total.

roadie
Full of knowledge
Full of knowledge
Posts: 205
Joined: 02 Jan 2011, 18:41
Distribution: Porteus 3.5...with a twist
Location: In a hayfield

Re: System clock

Post#3 by roadie » 03 Dec 2015, 16:21

It seems to be an Arch bug, only happens with it anyway. I don't try to keep the time right anymore.

User avatar
Ed_P
Contributor
Contributor
Posts: 3067
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: System clock

Post#4 by Ed_P » 03 Dec 2015, 17:04

Is there an Arch command to set the time-zone or the clock?
Ed

roadie
Full of knowledge
Full of knowledge
Posts: 205
Joined: 02 Jan 2011, 18:41
Distribution: Porteus 3.5...with a twist
Location: In a hayfield

Re: System clock

Post#5 by roadie » 03 Dec 2015, 17:13

Ed_P wrote:Is there an Arch command to set the time-zone or the clock?
No specific Arch commands....try hwclock or date....I haven't played with it myself.

roadie
Full of knowledge
Full of knowledge
Posts: 205
Joined: 02 Jan 2011, 18:41
Distribution: Porteus 3.5...with a twist
Location: In a hayfield

Re: System clock

Post#6 by roadie » 03 Dec 2015, 17:21

@Ed_P

Have you tried the setup commands in /usr/local/bin and sbin?
There are commands to setup a pile of things. Doesn't work for me, but I'm not running the same Porteus as you.

Edit
Try running setup-system..you should get a menu to do it all.

Another edit
If setup-system doesn't work, run tzselect and you get a cli setup...just pick your numbers for your locale.

User avatar
brokenman
Site Admin
Site Admin
Posts: 5439
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: System clock

Post#7 by brokenman » 03 Dec 2015, 18:00

Just read the config file for time. Set it there (/mnt/sdXy/config/time). I use an ntp server. It is damn annoying but it's the only way I can get the time to sit right. I believe you can also download a package called 'timeset' which has a lot of functions. I will look into why it is not dumping time to system clock on shutdown.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
Posts: 790
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
Location: australia
Contact:

Re: System clock

Post#8 by ncmprhnsbl » 03 Dec 2015, 21:45

Ed_P wrote:But even with the time zone wrong I don't think the OS should change the machine's clock without user involvement.
i agree, especially a portable OS..
what is your hardware running? localtime or UTC?
are far as i can see the config assumes UTC... ?
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
francois
Contributor
Contributor
Posts: 4905
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

Re: System clock

Post#9 by francois » 04 Dec 2015, 03:34

timezone in brokenman's config works perfectly for me.
Voltaire: Le mieux est l'ennemi du bien.

User avatar
Ed_P
Contributor
Contributor
Posts: 3067
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: System clock

Post#10 by Ed_P » 04 Dec 2015, 04:32

brokenman wrote:Just read the config file for time. Set it there (/mnt/sdXy/config/time).
Where do I look for it when I boot the ISO directly?
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 3067
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: System clock

Post#11 by Ed_P » 04 Dec 2015, 07:00

roadie wrote:Edit
Try running setup-system..you should get a menu to do it all.
A good command. And it works right up to the end.

Code: Select all

Unfortunately /mnt/isoloop/config/time is not writable. Please
edit this configuration file to survive a reboot.
Another edit
If setup-system doesn't work, run tzselect and you get a cli setup...just pick your numbers for your locale.
Another good command. Right up to the end.

Code: Select all

Therefore TZ='America/New_York' will be used.
Local time is now:	Fri Dec  4 01:34:12 EST 2015.
Universal Time is now:	Fri Dec  4 06:34:12 UTC 2015.
Is the above information OK?
1) Yes
2) No
#? 1

You can make this change permanent for yourself by appending the line
	TZ='America/New_York'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
America/New_York
guest ~ $ tzselect America/New_York
/usr/bin/tzselect: America/New_York: unknown argument
guest ~ $ tzselect --help
Usage: tzselect [--version] [--help] [-c COORD] [-n LIMIT]
Select a time zone interactively.
No .profile file in /home/guest. Several .bash files and others but no .profile. So I created one and added TZ='America/New_York' to it. Will see what happens next time I reboot.

But at least the time is correct at this point.
ncmprhnsbl wrote:what is your hardware running? localtime or UTC?
are far as i can see the config assumes UTC... ?
localtime. And I agree the config assumes UTC which is fine, but then it writes it to the hardware clock, when I reboot I suspect.
Last edited by Ed_P on 04 Dec 2015, 07:04, edited 1 time in total.
Ed

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: System clock

Post#12 by Ahau » 04 Dec 2015, 07:02

It appears to me that in Arch, the clock is set through (drumroll, please) systemd.

You can use "timedatectl" to set the clock, see https://wiki.archlinux.org/index.php/Time

Slackware based systems use "localtime" by default, meaning that the system clock matches the time of the hardware clock, with no offset for timezone. Systemd based systems use "UTC" clock by default, meaning the system assumes the hardware clock is set to UTC+0 (Greenwich Mean Time) and then it offsets the system time based on the timezone.

To clarify, is your system five hours ahead when you are in Nemesis, then when you reboot into another OS, the clock shows the correct time? Or, is the time correct in Nemesis, and when you boot back into another OS, at that point the time gets shifted by five hours? I've seen both issues; the prior is the result of not having the correct timezone set, and the latter would suggest a bug (in my experience, it occurs when you have the system clock set to localtime but you apply a timezone to it, then set the time to be what you think is correct. When the clock syncs from the system back to the hardware clock at shutdown, it offsets the hardware clock, which makes things go wonky in the next OS you boot into.

At any rate, it's not a bug I'm experiencing with Nemesis because my hardware clock is set to localtime (works out of the box in Porteus, and in Nemesis it shows the correct time by incorrectly assuming my clock is set to UTC and the default timezone is UTC). Given my experience with timezones in Porteus, though, I may be able to help work this one out.
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
Ed_P
Contributor
Contributor
Posts: 3067
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: System clock

Post#13 by Ed_P » 04 Dec 2015, 07:08

Ahau wrote:To clarify, is your system five hours ahead when you are in Nemesis,
Yes.
then when you reboot into another OS, the clock shows the correct time?
No, they are then all five hours ahead.
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 3067
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: System clock

Post#14 by Ed_P » 04 Dec 2015, 07:15

Ed_P wrote: No .profile file in /home/guest. Several .bash files and others but no .profile. So I created one and added TZ='America/New_York' to it. Will see what happens next time I reboot.
The .profile file option works. :Yahoo!:

Thanks guys. :friends:
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 3067
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: System clock - not solved

Post#15 by Ed_P » 04 Dec 2015, 17:46

:evil: Well, not fixed quite as well as I thought,

The clock displays correctly in Porteus 3.3 now but booting other OSs clocks are now 5 hours fast still. :wall:
Ed

Post Reply