Bug 44246 - univention-join sets time set via "rdate -n" but not "hwclock --systohc", which is lost after reboot
univention-join sets time set via "rdate -n" but not "hwclock --systohc", whi...
Status: REOPENED
Product: UCS
Classification: Unclassified
Component: Join (univention-join)
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-03 19:59 CEST by Arvid Requate
Modified: 2020-06-22 14:58 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2017-04-03 19:59:50 CEST
After the update to UCS 4.2 I have this behavior on an Samba/AD Master

root@master10:~# date
Mo 23. Nov 23:54:47 CET 2015
root@master10:~# rdate -n 10.200.8.1                                                            
Mon Apr  3 19:52:53 CEST 2017
root@master10:~# reboot
[...]
root@master10:~# date
Mo 23. Nov 23:54:57 CET 2015


So the hardware clock is not set to the system time at shutdown.

Maybe we should adjust the locations where we run rdate to also sync the hardware clock to the system time:

root@master10:~# hwclock --systohc
Comment 1 Philipp Hahn univentionstaff 2017-04-04 17:10:15 CEST
There is "/lib/systemd/system/hwclock-save.service", but as ntpd is installed on all UCS system roles, it is disabled by ConditionalFileIsExecutable.
Use "ucr set timeserver=0.europe.pool.ntp.org" (or whatever) and wait for at least 11 minutes after time has been synchronized; then the Linux kernel itself will update the RTC.

(if you use `rdate` by hand, you're supposed to use `hwclock --systohc --utc` by hand as well as you must know what you're doing - doing it automatically is wrong)
Comment 2 Arvid Requate univentionstaff 2017-04-04 19:34:07 CEST
> (if you use `rdate` by hand, you're supposed to use `hwclock --systohc --utc` by hand as well as you must know what you're doing - doing it automatically is wrong)

Well, that's the thing, we do rdate in univention-join.
Comment 3 Florian Best univentionstaff 2020-06-22 14:58:43 CEST
Still rdate in:

base/univention-ssl/debian/univention-ssl.postinst
base/univention-lib/python/admember.py
management/univention-join/univention-join
...