In Raspbian filesystems that do have /opt, attempting to start systemd service for htpdate results in the following error in syslog:
Sep 24 10:02:59 raspberrypi systemd[1]: Starting HTTP based time synchronization tool...
Sep 24 10:02:59 raspberrypi systemd[4405]: htpdate.service: Failed to set up mount namespacing: /run/systemd/unit-root/opt: No such file or directory
Sep 24 10:02:59 raspberrypi systemd[4405]: htpdate.service: Failed at step NAMESPACE spawning /usr/sbin/htpdate: No such file or directory
Sep 24 10:02:59 raspberrypi systemd[1]: htpdate.service: Control process exited, code=exited, status=226/NAMESPACE
Sep 24 10:02:59 raspberrypi systemd[1]: htpdate.service: Failed with result 'exit-code'.
Sep 24 10:02:59 raspberrypi systemd[1]: Failed to start HTTP based time synchronization tool.
The problem can be worked around by either creating /opt directory or editing the InaccessibleDirectories option in /usr/lib/systemd/system/htpdate.service to make /opt optional, i.e.
change:
InaccessibleDirectories=/boot /home /media /mnt /root /opt /srv
to:
InaccessibleDirectories=/boot /home /media /mnt /root -/opt /srv
In Raspbian filesystems that do have /opt, attempting to start systemd service for htpdate results in the following error in syslog:
Sep 24 10:02:59 raspberrypi systemd[1]: Starting HTTP based time synchronization tool... unit-root/ opt: No such file or directory 226/NAMESPACE
Sep 24 10:02:59 raspberrypi systemd[4405]: htpdate.service: Failed to set up mount namespacing: /run/systemd/
Sep 24 10:02:59 raspberrypi systemd[4405]: htpdate.service: Failed at step NAMESPACE spawning /usr/sbin/htpdate: No such file or directory
Sep 24 10:02:59 raspberrypi systemd[1]: htpdate.service: Control process exited, code=exited, status=
Sep 24 10:02:59 raspberrypi systemd[1]: htpdate.service: Failed with result 'exit-code'.
Sep 24 10:02:59 raspberrypi systemd[1]: Failed to start HTTP based time synchronization tool.
The problem can be worked around by either creating /opt directory or editing the InaccessibleDir ectories option in /usr/lib/ systemd/ system/ htpdate. service to make /opt optional, i.e. eDirectories= /boot /home /media /mnt /root /opt /srv eDirectories= /boot /home /media /mnt /root -/opt /srv
change:
Inaccessibl
to:
Inaccessibl
systemd version: 247.9-1+rpi1 03.a3c428a- 2
htpdate version: 1.2.6+git202109