[systemd-devel] PartOf= Question

Steve Dickson SteveD at redhat.com
Mon Jan 12 11:58:13 PST 2015


Hello,

The nfs-server service starts both the rpc-mountd service
and the rpc-idmapd service when the server is started.
But only brings down the rpc-mountd service when
the NFS server is stopped. 

I want nfs-server service to bring both services when
the server is stopped. 

Looking at the difference between rpc-mountd and 
rpc-idmapd services, I noted the rpc-mountd service
had:
   PartOf=nfs-server.service
   PartOf=nfs-utils.service

and the rpc-idmapd service did not. So I changed 
the rpc-idmapd.service to:

[Unit]
Description=NFSv4 ID-name mapping service
Requires=var-lib-nfs-rpc_pipefs.mount
After=var-lib-nfs-rpc_pipefs.mount
After=network.target
PartOf=nfs-server.service
PartOf=nfs-utils.service

Wants=nfs-config.service
After=nfs-config.service

[Service]
EnvironmentFile=-/run/sysconfig/nfs-utils
Type=forking
ExecStart=/usr/sbin/rpc.idmapd $RPCIDMAPDARGS

which does not work. rpc.idmapd is still running 
when the nfs-server service is stopped.

The man page clearly says:

  When systemd stops or restarts the units listed here, the action
  is propagated to this unit.

What am I missing about the PartOf option?

tia!

steved.
 


More information about the systemd-devel mailing list