Reputation: 235
I'm writing an application that needs to be able to set the time and date on a debian linux panel. I am able to successfully set both the system time and the hardware clock, but after a reboot the system clock is getting set back to the current time. The hardware clock remains at the time I changed it to prior to the reboot.
The machine this will be running on will not have any network or internet access, so (I think) I have removed NTP, but is there anything else that would be causing this to happen? Is there a way to verify that NTP is NOT running?
I am pretty much a linux newbie, so any assistance anyone can offer is greatly appreciated.
Upvotes: 1
Views: 6667
Reputation: 235
I contacted Technologic Systems (the hardware manufacturer) and determined this hardware has its own unique function for setting its hardware clock.
"The system clock on the TS-4700 is accessed using ts4700ctl:
ts4700ctl --getrtc # sets the system time from the RTC
ts4700ctl --setrtc # saves the system time to the RTC"
Sorry for thinking it was a Linux issue, but I'm glad I'm not going crazy!
Upvotes: 1
Reputation: 14619
In order to commit changes to the clock back to the hardware, you must run the hwclock
program:
/sbin/hwclock --systohc
Upvotes: 1