auto-mount NFS shares on boot

Michael Biebl biebl at debian.org
Sun Jun 28 11:54:13 BST 2015


[ bringing pkg-systemd-maintainers into the loop here ]

Am 27.06.2015 um 20:14 schrieb Christian Seiler:
> On 06/27/2015 08:02 PM, Jonas Meurer wrote:
>> Am 27.06.2015 um 16:07 schrieb Christian Seiler:
>>> Could you try to do the following:
>>>
>>> 1. create a directory /etc/systemd/system/remote-fs-pre.target.d
>>> 2. create a file /etc/systemd/system/remote-fs-pre.target.d/nfs.conf
>>>    with the following contents:
>>>
>>> [Unit]
>>> After=nfs-common.service
>>>
>>> And then reboot your system? I would bet it should work then.
>>
>> Perfect, that solution works like a charm. nfs-common is started before
>> remote-fs, thus rpc.gssd runs already when the NFS share is mounted.
> 
> Great, glad I could solve your problem. :)
> 
>> I suggest to add this simple fix to Jessie by uploading it to
>> stable-proposed-updates. What do you think? Also, do you think that
>> /etc/systemd/system/remote-fs-pre.target.d/nfs.conf belongs to systemd
>> package or to nfs-common? I would say it belongs to nfs-common as that
>> one provides the required tools and services to mount NFS shares on a
>> client.
> 
> So the fix I gave you is a fix that shouldn't be copied verbatim into
> a Debian package. /etc/systemd is administrator territory, /lib/systemd
> is package territory, so any proper fix of a package should go to /lib.
> 
> Furthermore, my suggestion for your problem was to add a drop-in that
> augments the Debian-provided unit files (see man systemd.unit for how
> drop-ins work) - which is great since you only want to extend the unit,
> not completely replace it.
> 
> But in the packages themselves it is perfectly possible to modify the
> unit files themselves, so a drop-in is not necessary at all for any
> native unit.
> 
> So for Stretch:
> 
>  - assuming that nfs-common will have a native unit by then, the
>    proper fix would be to simply add Before=remote-fs-pre.target
>    to that unit, and that would fix that
> 
> For Jessie:
> 
>  - nfs-common is still an init script, so one cannot simply add
>    Before=remote-fs-pre.target to that. But there are two other
>    options:
> 
>  - just for Jessie: update systemd to change the original unit file
>    remote-fs-pre.target to include After=nfs-common.service
> 
>  - or alternatively, package a drop-in in /lib in the nfs-common
>    package, i.e.
>    /lib/systemd/system/nfs-common.service.d/systemd-ordering.conf:
>    [Unit]
>    Before=remote-fs-pre.target
> 
> (IMHO at least, I'll defer to the maintainers of the respective
> packages as to what they think is appropriate.)

Certainly, the preferred fix is, that packages ship native service files
which override/replace the sysv init scripts.
In case of nfs-common/rpcbind, Ubuntu has done some extensive work to
properly integrate nfs-common/rpcbind with systemd.

This hasn't landed in Debian (yet) and is not something which can be
backported for jessie.

The drop-in snippet for nfs-common to augment the dependency information
when being run under systemd is something which seems to be suitable for
jessie and could be added to the package in sid to give it some testing
first. Ideally, that drop-in is shipped by the package itself. This
would mean a stable upload for nfs-common.

Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-systemd-maintainers/attachments/20150628/34a35f9b/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list