htpdate service does not start when /opt does not exist

Bug #1944789 reported by Frank Chung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Raspbian
New
Undecided
Unassigned

Bug Description

In Raspbian filesystems that do not 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

systemd version: 247.9-1+rpi1
htpdate version: 1.2.6+git20210903.a3c428a-2

Frank Chung (chungf)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.