[systemd-devel] Stacked automount dependencies
Michael Chapman
mike at very.puzzling.org
Fri Mar 30 02:25:48 UTC 2018
On Fri, 30 Mar 2018, Kenneth Porter wrote:
> I need to automount a couple cifs shares on a NAS box, with one share mounted
> to a directory within another share:
>
> /srv/share0/share1
This probably isn't going to work the way you want. Starting the share1
automount will itself cause share0 to be mounted, since systemd needs to
ensure that the share1 directory exists, and to mount an autofs
filesystem at this directory.
If you stack automounts in this way, the "inner" automount essentially
keeps the "outer" mount permanently in use.
> I've created the unit files for .mount and .automount for the two shares,
> with mount disabled and automount enabled and started. This seems to work
> fine once the system is booted. But the share1 automount fails to start on
> boot with the error "dependency". The share0 automount is started and works
> when the mount point is later accessed, but not the share1 automount.
>
> I don't know what to add to satisfy the boot-time dependency of
> srv-share0-share1.automount.
>
>> From the boot log, it looks like the system is trying to actually mount
> these shares. But the server they're being mounted from may not be up yet
> when both are powering up together. That's why I'm using an automount.
>
> Mar 26 18:29:14 saruman kernel: CIFS VFS: Error connecting to socket.
> Aborting operation.
> Mar 26 18:29:14 saruman kernel: CIFS VFS: cifs_mount failed w/return code =
> -113
> Mar 26 18:29:14 saruman mount: Unable to find suitable address.
> Mar 26 18:29:14 saruman systemd: srv-share0.mount mount process exited,
> code=exited status=32
> Mar 26 18:29:14 saruman systemd: Failed to mount NAS1 share0.
So what's happening here is that systemd is trying to mount share0, which
is failing...
> Mar 26 18:29:14 saruman systemd: Dependency failed for Automount NAS1 share1.
> Mar 26 18:29:14 saruman systemd: Job srv-share0-share1.automount/start failed
> with result 'dependency'.
... which means it can't start the automount inside it.
More information about the systemd-devel
mailing list