On my Raspbian (based on Debian Jessie), I need to start at boot rpcbind
and nfs-common
services because I need them to start autofs
at boot for a NFS mount.
Since Debian Jessie now has moved to systemd
, I want to know the best way to start those 3 services (rpcbind, nfs-commond, autofs) in the correct order to avoid issues.
If I manually mount the NFS share it works. And it also works when using the autofs service with rpcbind and nfs-common already up and running.
autofs uses a systemd unit script. About the other 2 services, should I make init.d scripts or do I have to create systemd unit files? How can I write them?
autofs
provides a systemd unit as you point out, and even thoughrpcbind
andnfs-common
don't (yet), theirinit.d
scripts are taken into account by systemd. (I use all three and didn't need to fix anything after upgrading to Jessie and switching to systemd.) Is there a specific problem you're seeing?rpcbind
andnfs-common
are loaded beforeautofs
. It should be easier to do with systemd unit file since you can specify dependecies and so the correct order. But I never used systemd before and never wrote a systemd unit file, so I don't know how to do that the right way. Otherwise how is it possible to assure this with init.d?init.d
, the order is defined by theBEGIN INIT INFO
comments (Required-Start
,Should-Start
etc.). On my systems, running System V init or systemd, the scripts are automatically ordered such thatrpcbind
andnfs-common
are started beforeautofs
.sudo update-rc.d rpcbind enable
andsudo update-rc.d nfs-common enable
. Onlynfs-common
starts at boot correctly butrpcbind
not. So I tried alsosudo update-rc.d rpcbind defaults
but no way. The only workaround is to addservice rpcbind start
inside the/etc/rc.local
script but it's not the proper way... Any suggestion?