Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 18 Oct 2019, 04:44
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
System clock out of sync with hardware clock
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
Jynxd

Joined: 15 May 2019
Posts: 14

PostPosted: Wed 15 May 2019, 21:26    Post subject:  System clock out of sync with hardware clock
Subject description: Wow, look at the time! I could have sworn it was 4 hours later!
 

Hello, I have a problem that every time I run Puppy Linux I find that the time is 4 hours behind of what it should be, I have the timezone set correctly, and I even had to do a symbolic link of two files by doing "cp /usr/share/zoneinfo/America/Caracas /etc/localtime", and then "date --date='TZ="America/Caracas"', before that the time was off by another 4 hours, harware clock is also properly set as local (and local is how I want it, please don't suggest UTC), I ran "hwclock --localtime", when I run "hwclock -s" everything is fine, except I have to do it every time I boot the computer even if I save the session.

I triple-boot windows/xubuntu/puppy linux, this problem was solved on xubuntu by doing "timedatectl set-time-rtc 1", and then the same hwclock commands. The problem is "timedatectl" is not a command found on my puppy linux.

My setup is:
Xenialpup64 7.5
Running from a live flash drive, sessions are set to be saved manually.
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 12731
Location: S.C. USA

PostPosted: Wed 15 May 2019, 22:31    Post subject:  

Good idea to run desktop icon Quickpet>Info>Xenialpup updates and save to have the latest bug fixes.

Not sure if this will work after you did those manual changes to files.

Use the programs menu>Desktop>Set Timezone and menu>Desktop>Set Date and Time.

In Set Timezone try using the GMT-4 setting.
Make sure the Hardware Clock set to UTC is not checked.

You are sure the hardware clock is set correctly in the computers bios and it actually is working good?
Computers bios battery is good?

After you change the settings.
Click on the desktop save icon to make sure it gets into the save.

Trying to fix Puppy by using a fix for Xubuntu is never a good idea.
Puppy does a lot of things the Puppy way.

_________________
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
YaPI(any iso installer) http://www.murga-linux.com/puppy/viewtopic.php?t=107601
Back to top
View user's profile Send private message 
williams2

Joined: 14 Dec 2018
Posts: 183

PostPosted: Thu 16 May 2019, 01:35    Post subject:  

Quote:
I even had to do a symbolic link of two files by doing "cp /usr/share/zoneinfo/America/Caracas /etc/localtime"

If localtime is a symlink, and you did a "cp" as opposed to a "ln", it will copy the contents of the Caracas file overwriting whatever localtime was linked to. Which is not what you intended. If you used ln -s it should have worked properly.

You can see what /etc/localtime is linked to by typing:
ls -l /etc/localtime
or move the mouse cursor over the file in RoxFiler.

If you properly setup your time from the menu it should work properly. It might be good to boot Puppy to ram (pfix=ram) and see if you can set the time/date/timezone properly.

Puppy should do this automatically every time you boot:

hwclock --hctosys --localtime

If you want you can put that in /etc/rc.d/rc.local but it really shouldn't be necessary.

Do you have a /etc/adjtime file? Is it using LOCAL or UTC? Is the number at the top left much bigger than 2 or 3 seconds? If it is wrong it could make your time wrong. /etc/adjtime will only work if you set the hardware clock from the same OS. You can set the hardware clock on one OS and copy adjtime from there to your other OSs.

If your time is wrong by 4 hrs it could be you are using UTC.

What is your TZ set to when you boot? type:
echo $TZ
If it is wrong it needs to be set in /etc/profile. Again, you should be able to configure everything from the menu.

Is your hardware clock set properly? This should display the correct time:
TZ="America/Caracas"
hwclock --show --localtime
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14406
Location: Gatineau (Qc), Canada

PostPosted: Thu 16 May 2019, 05:14    Post subject:  

Hello.

In your xenial, you should have an entry in the Desktop sub-menu called PSync. It is
designed to keep the clock of your computer synchronized with the rest of the world! Smile
Try it?

Good luck.
PSync.jpg
 Description   
 Filesize   46.19 KB
 Viewed   191 Time(s)

PSync.jpg


_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Jynxd

Joined: 15 May 2019
Posts: 14

PostPosted: Thu 16 May 2019, 08:53    Post subject:  

bigpup wrote:
Use the programs menu>Desktop>Set Timezone and menu>Desktop>Set Date and Time.

In Set Timezone try using the GMT-4 setting.
Make sure the Hardware Clock set to UTC is not checked.

You are sure the hardware clock is set correctly in the computers bios and it actually is working good?
Computers bios battery is good?

After you change the settings.
Click on the desktop save icon to make sure it gets into the save.

Trying to fix Puppy by using a fix for Xubuntu is never a good idea.
Puppy does a lot of things the Puppy way.

Going through the menus in the GUI was the first thing I did.

bigpup wrote:
You are sure the hardware clock is set correctly in the computers bios and it actually is working good?
Computers bios battery is good?

Trying to fix Puppy by using a fix for Xubuntu is never a good idea.
Puppy does a lot of things the Puppy way.


But it's hard to find fixes specifically aimed at puppy linux, and I exhaust solutions from internet searches before I ask on the internet, the hardware clock on the GUI was not set to UTC, it was the first thing I tried.

The computer bios is working correctly, the battery is working correctly.

williams2 wrote:
Quote:
I even had to do a symbolic link of two files by doing "cp /usr/share/zoneinfo/America/Caracas /etc/localtime"

If localtime is a symlink, and you did a "cp" as opposed to a "ln", it will copy the contents of the Caracas file overwriting whatever localtime was linked to. Which is not what you intended. If you used ln -s it should have worked properly.

You can see what /etc/localtime is linked to by typing:
ls -l /etc/localtime
or move the mouse cursor over the file in RoxFiler.

If you properly setup your time from the menu it should work properly. It might be good to boot Puppy to ram (pfix=ram) and see if you can set the time/date/timezone properly.

Puppy should do this automatically every time you boot:

hwclock --hctosys --localtime

If you want you can put that in /etc/rc.d/rc.local but it really shouldn't be necessary.

Do you have a /etc/adjtime file? Is it using LOCAL or UTC? Is the number at the top left much bigger than 2 or 3 seconds? If it is wrong it could make your time wrong. /etc/adjtime will only work if you set the hardware clock from the same OS. You can set the hardware clock on one OS and copy adjtime from there to your other OSs.

If your time is wrong by 4 hrs it could be you are using UTC.

What is your TZ set to when you boot? type:
echo $TZ
If it is wrong it needs to be set in /etc/profile. Again, you should be able to configure everything from the menu.

Is your hardware clock set properly? This should display the correct time:
TZ="America/Caracas"
hwclock --show --localtime


I'll give it a shot, The "cp" command is something I found online, I really don't know what it does, except after I did it, if I set the time from puppy linux, I finally had a properly working clock with wich I could use Tor, going back to windows showed the wrong time though. Using pSync just made the time off by 8 hours, I tried that too.
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 12731
Location: S.C. USA

PostPosted: Thu 16 May 2019, 09:44    Post subject:  

Quote:
What is your TZ set to when you boot? type:
echo $TZ
If it is wrong it needs to be set in /etc/profile. Again, you should be able to configure everything from the menu.

Is your hardware clock set properly? This should display the correct time:
TZ="America/Caracas"
hwclock --show --localtime

Please answer these questions.
Enter commands in console.

Have you tried time/date setup when booting not using the Puppy save?
Do you know how to boot not using the save?

_________________
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
YaPI(any iso installer) http://www.murga-linux.com/puppy/viewtopic.php?t=107601
Back to top
View user's profile Send private message 
Jynxd

Joined: 15 May 2019
Posts: 14

PostPosted: Thu 16 May 2019, 09:57    Post subject:  

I tried "ln -s /user/share/zoneinfo/America/Caracas /etc/localtime",
but this is what it said:"ln: failed to create symbolic link '/etc/localtime': File exists"

I tried "ls -l /user/share/zoneinfo/America/Caracas /etc/localtime" but this is what it said "ls: cannot access '/user/share/zoneinfo/America/Caracas': No such file or directory
lrwxrwxrwx 1 root root 29 May 10 06:21 /etc/localtime -> /usr/share/zoneinfo/Etc/GMT-4"

This is what's inside "/etc/adjtime":

0.000000 1557717705 0.000000
1557717705
LOCAL

And etc/localtime shows:
"/user/share/zoneinfo/Etc/GMT-4"

"echo $TZ" Shows a blank line, no error or anything else. "TZ="America/Caracas" hwclock --show --localtime" shows the correct time: Thu 16 May 2019 09:51:19 AM -04 .874115 seconds.

I don't know how to boot without loading a save, not without moving or deleting the save file, how do I do that?.
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 12731
Location: S.C. USA

PostPosted: Thu 16 May 2019, 10:16    Post subject:  

If Xenialpup is a live USB install.
I will assume it is using the boot menu that is part of the live install.
Should be booting to a boot menu.
One of the menu entries is xenialpup-ram or xenialpup with no savefile.
Use that entry to boot.

Should boot the way it did the first time you ever booted. No setup or settings in affect.
Do not do anything but basic setup.
Timezone and time.
Shutdown and when asked make a new save.
Give it an added name to make it different from the old save name.
Place it in same location as the old save.

Now reboot selecting the normal boot menu entry.
Because there are two saves it will ask which one to use.
Use the new one to see what time setting now does at boot up.

Any change?

_________________
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
YaPI(any iso installer) http://www.murga-linux.com/puppy/viewtopic.php?t=107601
Back to top
View user's profile Send private message 
Jynxd

Joined: 15 May 2019
Posts: 14

PostPosted: Thu 16 May 2019, 10:27    Post subject:  

Yeah, I saw that after reading your other comment, always there, I just never read it. This is what I got with no save:

root# hwclock
Thu 16 May 2019 01:58:43 PM +04 .827376 seconds
root# hwclock -r --localtime
Thu 16 May 2019 09:59:01 AM +04 .546117 seconds
root# hwclock --localtime
root# hwclock -r --localtime
Thu 16 May 2019 09:59:13 AM +04 .842992 seconds
root# hwclock
Thu 16 May 2019 01:59:18 PM +04 .592992 seconds
root# hwclock -s
root# hwclock -r --localtime
Thu 16 May 2019 09:59:50 AM +04 .592971 seconds
root# hwclock -s --localtime
root# hwclock
Thu 16 May 2019 02:00:01 PM +04 .432337 seconds
root# date
Thu May 16 10:00:09 +04 2019
root# date -u
Thu May 16 06:00:14 UTC 2019
root# ls -l /usr/share/zoneinfo/America/Caracas /etc/localtime/
ls: cannot access '/etc/localtime/': Not a directory
-rw-r--r-- 1 root root 275 Nov 10 2017 /usr/share/zoneinfo/America/Caracas
root# ls -l /etc/localtime
lrwxrwxrwx 1 root root 29 May 16 05:58 /etc/localtime -> /usr/share/zoneinfo/Etc/GMT-4

Without the save "hwclock" shows a +4, and it should be a -4, on the old save both show the same result.

I'm gonna try what you just said with a new save.
Back to top
View user's profile Send private message 
Jynxd

Joined: 15 May 2019
Posts: 14

PostPosted: Thu 16 May 2019, 10:57    Post subject:  

Is it ok to double post an update? If not, apologies.

With a brand new save, if I set everything correctly, and make the clock show the correct time, then Tor doesn't work because it claims the time is wrong.

With my old save Tor works and shows the correct time, but only after I do "hwclock -s", and that's every time I boot.
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 12731
Location: S.C. USA

PostPosted: Thu 16 May 2019, 11:17    Post subject:  

So, Tor is your problem?

https://tor.stackexchange.com/questions/3482/how-to-change-tor-browser-time-zone

_________________
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
YaPI(any iso installer) http://www.murga-linux.com/puppy/viewtopic.php?t=107601
Back to top
View user's profile Send private message 
williams2

Joined: 14 Dec 2018
Posts: 183

PostPosted: Thu 16 May 2019, 17:34    Post subject:  

Quote:
With my old save Tor works and shows the correct time, but only after I do "hwclock -s", and that's every time I boot.

It is easy to run hwclock automatically every time you boot, edit /etc/rc.d/rc.local and put hwclock -s in the file. Even if your system clock is set properly, Tor still may need to be configured.

To set TZ, put this in /etc/profile near the end of the file:

export TZ="America/Caracas"

This should link /etc/localtime properly:

ln -sf /usr/share/zoneinfo/America/Caracas /etc/localtime

That is ln -sf not ls -sf.

Your adjtime file looks ok.

The configuration programs in the menu should set everything up for you, but you can do it manually too.
Back to top
View user's profile Send private message 
Jynxd

Joined: 15 May 2019
Posts: 14

PostPosted: Sat 18 May 2019, 13:27    Post subject:  

williams2 wrote:

To set TZ, put this in /etc/profile near the end of the file:

export TZ="America/Caracas"

This should link /etc/localtime properly:

ln -sf /usr/share/zoneinfo/America/Caracas /etc/localtime

That is ln -sf not ls -sf.

Your adjtime file looks ok.

The configuration programs in the menu should set everything up for you, but you can do it manually too.


Oh yeah! That did the job, thanks! I was about to give up and do this:

williams2 wrote:
It is easy to run hwclock automatically every time you boot, edit /etc/rc.d/rc.local and put hwclock -s in the file.


All times are correct now, and Tor works with no problem.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0615s ][ Queries: 13 (0.0090s) ][ GZIP on ]