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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
Signed-off-by: Yongcheng Yang <yoyang@xxxxxxxxxx>
---
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(-)

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
-- 
2.20.1




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux