Re: [chrony-users] Resume from suspend and default makestep configuration |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
- To: "chrony-users@xxxxxxxxxxxxxxxxxxxx" <chrony-users@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: [chrony-users] Resume from suspend and default makestep configuration
- From: FUSTE Emmanuel <emmanuel.fuste@xxxxxxxxxxxxxxx>
- Date: Mon, 18 May 2020 13:45:04 +0000
- Accept-language: fr-FR, en-US
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thalesgroup.com; s=xrt20181201; t=1589809504; bh=Idryig7TvnL1CBvJdZiCARJitGLW+NVkVaO01QgBSgI=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:From; b=fIlLULwU28qPT+/VA/j9nHv8LbWq4H80Blgi48+ZCij8/7qRHrPRJFkWm1Qa6AVMa bd/UXfofmuxbvJ8EeJdb11SPMx1ag6ofAsXVMBbyscA16ZoNh1srbG+/OB+sYWOdVk 6f0nWAlLVMuBdW+IlPixrDRAW2dVcCWKtarH7QW6KJIBjjMA59AbEB6MnOAuGvIKWm A4Se2fBjSL+fEAG2bmz97Gz2EwejESsYNNJp4BvsARlowkeB2bXEoh+bqYUPSP5Q0S ttFIo7xgFz+j9x6r1bxxD5CvDu/YT5CnzPFs7vj26S8YkPnbeiZh2yFDiD2W2+Cuh8 L4Y4hzUU5TP0A==
- Thread-index: AQHWJZCybs6tsl5rVkeZuk2veTx73Kiidm+AgAsddICAAAI2AIAACJIAgAApuoA=
- Thread-topic: [chrony-users] Resume from suspend and default makestep configuration
Le 18/05/2020 à 13:15, Pali Rohár a écrit :
> On Monday 18 May 2020 10:45:02 FUSTE Emmanuel wrote:
>> Hello Pali,
>>
>> Le 18/05/2020 à 12:37, Pali Rohár a écrit :
>>> The main problem is when system is put into suspend or hibernate state.
>>>
>>> In my opinion resuming from suspend / hibernate state should be handled
>>> in the same way as (re)starting chronyd. You do not know what may
>>> happened during sleep.
>> Yes and in case of needed workaround, it should be done at the system
>> level, not chrony.
>> A job for systemd.
> Hello! Sorry for a stupid question, but what has systemd in common with
> chronyd? Why should systemd care about chronyd time synchronization?
Nothing.
But it is to your "process manager" being systemd, sysvinit pile of
scripts or whatever to restart or notify chrony, it has do do
housekeeping anyway for other things when you suspend/resume.
Exactly as networkmanager, ifupdown scripts, systemd-networkd
reload/restart some network services when interfaces/tunnels/vpn are
upped/downed.
>>> And as I pointed there are existing problems that UEFI/BIOS firmware
>>> changes RTC clock without good reason which results in completely wrong
>>> system clock.
>>>
>> Could well be identified by blacklist at the udev/systemd level for
>> applying or not the workaround (restart chrony or launch a chronyc
>> command at resume)
> Could you describe in details what do you mean by blacklist? Which udev
> blacklist you mean and what should be put into that blacklist? I have
> not caught this part.
Faulty systems could be identified by DMI/ACPI strings and quirk applied.
See for example /lib/udev/hwdb.d/60-sensor.hwdb for some laptop sensors.
We could add an attribute to the RTC if it matche some vendor/bios
version/model etc... to put in the hwdb (the blacklist)
A udev rule will assign this attribute to the RTC if you are running on
a known buggy system.
A script could do anything you want at suspend/resume time in
/lib/systemd/system-sleep if your RTC has the offended attribute (see
systemd-sleep man page).
Or better, a unit run at resume time could do anything too.
The hwdb abstraction is not need if it is a local hack and should be
properly defined with the hwdb/udev/systemd developers.
If raised to the systemd developers, systemd-sleep / resume could take
care directly and fire an appropriate target with a formally defined
attribute in the hwdb.
What to do with this target could be configurable and default to time
daemon restart.
I'm not a systemd/udev/hwdb expert/develloper, but I think this is a
good track and deserve a discussion with them.
Anyway, the level to tackle the problem is not chrony and the proper
level for managing the problem is the init/process manager. Hwdb/udev is
"a" way to share the faulty systems information across "init" ecosystem.
Information that is usefully not only for chrony.
Emmanuel.