[systemd-devel] Order-only mount units?

Norbert Lange nolange79 at gmail.com
Sat Jan 7 16:06:36 UTC 2023


Hello,

Say want a service unit which mounts some stuff, then does further
steps (create some initial files, etc..).
The problem here is that it is not automatically ordered in regards to
mounts in the subdirectories or some other dependencies like
RequiresMountsFor - that would happen with a mount unit.

So the idea would be to add a dummy mount unit with a dependency to the service.
like this:

[Unit]
Description=My dummy mount
After=realmount.service

[Mount]
# What were need to be adapted to what realmount.service does
What=*
Where=/mountpoint
Type=*
Options=remount

Any thought on this?
Without a mount unit there is alot of implicit stuff thats hard to recreate.

Another option would be that realmount.service mounts on another path,
then the dummy mount unit doing a "bind mount" or move, but I am not
sure systemd allows that?

Norbert


More information about the systemd-devel mailing list