[systemd-devel] Order-only mount units?
Andrei Borzenkov
arvidjaar at gmail.com
Sat Jan 7 18:34:02 UTC 2023
On 07.01.2023 19:06, Norbert Lange wrote:
> 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.
>
Add them to /etc/fstab with "noauto" and use RequiresMountsFor. Unless I
misunderstand what you need.
> 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