diff mbox series

systemd: nfs-server.service add "Wants" dependency on rpc-rquotad.service

Message ID 20210430065601.16523-1-yoyang@redhat.com (mailing list archive)
State New
Headers show
Series systemd: nfs-server.service add "Wants" dependency on rpc-rquotad.service | expand

Commit Message

Yongcheng Yang April 30, 2021, 6:56 a.m. UTC
The RPC quota service was part of nfs-utils and started together
with nfs-server before it was splitting out from nfs-utils.

It would be convenient to preserve the behavior: Let nfs-server
start rpc-rquotad automatically.

Signed-off-by: Petr Pisar <ppisar@redhat.com>
Signed-off-by: Yongcheng Yang <yoyang@redhat.com>
---
Hi,

The rpc-rquotad.service contains "WantedBy=nfs-server.service" but it only
takes effect after "systemctl enable rpc-rquotad":

"A symbolic link is created in the .wants/ directory of each of the listed
units when this unit is installed by systemctl enable"

This is different with the previous behavior when it's not splitted.

Test logs:
~~~~~~~~~~
[root@rhel-latest ~]# systemctl is-enabled rpc-rquotad
disabled
[root@rhel-latest ~]# systemctl start nfs-server
[root@rhel-latest ~]# systemctl status rpc-rquotad
* rpc-rquotad.service - Remote quota server
   Loaded: loaded (/usr/lib/systemd/system/rpc-rquotad.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:rpc.rquotad(8)
[root@rhel-latest ~]#
[root@rhel-latest ~]# systemctl enable rpc-rquotad
Created symlink /etc/systemd/system/multi-user.target.wants/rpc-rquotad.service -> /usr/lib/systemd/system/rpc-rquotad.service.
Created symlink /etc/systemd/system/nfs-server.service.wants/rpc-rquotad.service -> /usr/lib/systemd/system/rpc-rquotad.service.
[root@rhel-latest ~]# systemctl restart nfs-server
[root@rhel-latest ~]# systemctl status rpc-rquotad
* rpc-rquotad.service - Remote quota server
   Loaded: loaded (/usr/lib/systemd/system/rpc-rquotad.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2021-04-30 02:17:33 EDT; 6s ago
     Docs: man:rpc.rquotad(8)
 Main PID: 5821 (rpc.rquotad)
    Tasks: 1 (limit: 7971)
   Memory: 12.7M
   CGroup: /system.slice/rpc-rquotad.service
           `-5821 /usr/sbin/rpc.rquotad

Apr 30 02:17:33 rhel-latest systemd[1]: Starting Remote quota server...
Apr 30 02:17:33 rhel-latest systemd[1]: Started Remote quota server.
[root@rhel-latest ~]#

Thanks,
Yongcheng

 systemd/nfs-server.service | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

NeilBrown May 4, 2021, 3:34 a.m. UTC | #1
On Fri, 30 Apr 2021, Yongcheng Yang wrote:
> The RPC quota service was part of nfs-utils and started together
> with nfs-server before it was splitting out from nfs-utils.
> 
> It would be convenient to preserve the behavior: Let nfs-server
> start rpc-rquotad automatically.
> 
> Signed-off-by: Petr Pisar <ppisar@redhat.com>
> Signed-off-by: Yongcheng Yang <yoyang@redhat.com>

I would prefer that whatever package provides rpc-rquotad should take
care of this.
It can provide a "wants" symlink

  .../systemd/system/nfs-server.wants/rpc-rquotad.service -> .../rpc-rquotad.service

NeilBrown
diff mbox series

Patch

diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index b432f910..16eca3f9 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -3,7 +3,8 @@  Description=NFS server and services
 DefaultDependencies=no
 Requires=network.target proc-fs-nfsd.mount
 Requires=nfs-mountd.service
-Wants=rpcbind.socket network-online.target
+Wants=network-online.target
+Wants=rpcbind.socket rpc-rquotad.service
 Wants=rpc-statd.service nfs-idmapd.service
 Wants=rpc-statd-notify.service
 Wants=nfsdcld.service