Suspend/Hibernate changes clock?

I’ve been experimenting with suspend and hibernate (Gnome3, 12.1) and it seems to be doing odd things to my clock.
I have a clock checking call to sntp running from crontab to see that my clock is in sync. After a resume from RAM or disk it may have a problem and find that the clock is 11 secs wrong. This part seems to be consistent. As soon as my local dovecot finds the time discrepancy it panics and shuts down. I go into Yast to reset the mail server and find a number of items that normally start up ok from cold are displaying asterisks indicating that they have entered a non functional state. One I recall is ‘random’. When I do a disable/enable on each they all start up again fine after the clock has settled down. Sound familiar to anybody?

Yes, I am exposing myself to comments such as why are you running server processes on a machine you want to suspend, etc etc but they are just local services. Right now it is easier to do a cold shutdown / reboot than it is to resume from ram|disk and have to restart a bunch of running processes.

On 2012-02-05 20:36, colbec wrote:
>
> I’ve been experimenting with suspend and hibernate (Gnome3, 12.1) and it
> seems to be doing odd things to my clock.
> I have a clock checking call to sntp running from crontab to see that
> my clock is in sync. After a resume from RAM or disk it may have a
> problem and find that the clock is 11 secs wrong. This part seems to be
> consistent. As soon as my local dovecot finds the time discrepancy it
> panics and shuts down.

I think I have seen that once. But not when the clock is “bad”, but when
the clock is adjusted (jumped) more than usual.

> I go into Yast to reset the mail server

YaST? You can restart it from the command line. With systemv you use
“rcdovecot restart”. With systemd there is another command, but the one
above also works, I think.

> and find
> a number of items that normally start up ok from cold are displaying
> asterisks indicating that they have entered a non functional state.

There should be a CLI command to do that faster.

> One
> I recall is ‘random’.

Curious.

> When I do a disable/enable on each they all start
> up again fine after the clock has settled down. Sound familiar to
> anybody?
>
> Yes, I am exposing myself to comments such as why are you running
> server processes on a machine you want to suspend,

Not at all. I do the same.

> etc etc but they are
> just local services. Right now it is easier to do a cold shutdown /
> reboot than it is to resume from ram|disk and have to restart a bunch of
> running processes.

In my 11.4 it works fine.

Let me see, you can delete the file “/etc/adjtime”, which is used to adjust
the clock when the machine boots. Also, in “/etc/pm/sleep.d/” you can copy
a clocl script to adjust the clock when thawing. There is another in
“/usr/lib/pm-utils/sleep.d”, which at this moment I don’t remember if it is
the place where I copied the script from, or it also runs. I think it runs
if NEED_CLOCK_SYNC is enabled somewhere. I think in “/etc/pm/config.d/config”.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Thanks for these observations.
Further investigation shows that the failure of the services other than dovecot appear to be independent of this time issue. Yast shows that even from cold boot they have a problem where dovecot does not. I will be looking at these separately.
Quite agree, rc+service is great but Yast-SystemServices gives a quick overview of the status of services.

On 2012-02-06 00:46, colbec wrote:
> Quite agree, rc+service is great but Yast-SystemServices gives a quick
> overview of the status of services.


chkconfig -l

does the same in 11.4 with systemd. With systemv I don’t know if it works.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 2012-02-06 01:13, Carlos E. R. wrote:
> does the same in 11.4 with systemd. With systemv I don’t know if it works.

Oops. The other way round.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Just a last comment on this, I have found that if I turn off my crontab sntp check and turn on the Gnome 3 “Network time” under date and time (default is “off”) then the clock behaves properly. Resume from hibernate does not interfere with my local dovecot which keeps running normally. I’m not exactly sure what the network time thing does, but casual observation so far is that the clock is stable.

On 2012-02-06 21:36, colbec wrote:
>
> Just a last comment on this, I have found that if I turn off my crontab
> sntp check and turn on the Gnome 3 “Network time” under date and time
> (default is “off”) then the clock behaves properly. Resume from
> hibernate does not interfere with my local dovecot which keeps running
> normally. I’m not exactly sure what the network time thing does, but
> casual observation so far is that the clock is stable.

If you adjust the clock slowly, daemons keep happy. If you “jump” the clock
by more than a certain ammount, some daemons are bewildered and quit. It
happens in the *nix world.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)