c99586
From bf842d0cf9ae13408e20963c977d3c85642a69b3 Mon Sep 17 00:00:00 2001
c99586
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
c99586
Date: Thu, 18 Jun 2020 09:38:13 -0400
c99586
Subject: [PATCH] systemd: revised drop-in conf file handling
c99586
c99586
see https://bugzilla.redhat.com/show_bug.cgi?id=1848208
c99586
c99586
systemd service file documentation still sucks rocks
c99586
c99586
This is my current best guess, and at least it doesn't log errors
c99586
c99586
Change-Id: Iec9847356090e561bfcd5f41a64b35c2e686a3d6
c99586
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
c99586
---
c99586
 src/nfs-ganesha.spec-in.cmake                         | 6 +++---
c99586
 src/scripts/systemd/nfs-ganesha-lock.service.debian10 | 2 +-
c99586
 src/scripts/systemd/nfs-ganesha-lock.service.el8      | 2 +-
c99586
 src/scripts/systemd/rpc-statd.conf.debian10           | 2 +-
c99586
 src/scripts/systemd/rpc-statd.conf.el8                | 2 +-
c99586
 5 files changed, 7 insertions(+), 7 deletions(-)
c99586
c99586
diff --git a/src/nfs-ganesha.spec-in.cmake b/src/nfs-ganesha.spec-in.cmake
c99586
index 9cfda6c0e..d66106d6f 100644
c99586
--- a/src/nfs-ganesha.spec-in.cmake
c99586
+++ b/src/nfs-ganesha.spec-in.cmake
c99586
@@ -557,13 +557,13 @@ install -m 644 config_samples/vfs.conf %{buildroot}%{_sysconfdir}/ganesha
c99586
 
c99586
 mkdir -p %{buildroot}%{_unitdir}
c99586
 %if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 8 )
c99586
-mkdir -p %{buildroot}%{_sysconfdir}/systemd/system/nfs-ganesha.d
c99586
+mkdir -p %{buildroot}%{_sysconfdir}/systemd/system/nfs-ganesha-lock.service.d
c99586
 %endif
c99586
 
c99586
 install -m 644 scripts/systemd/nfs-ganesha.service.el7	%{buildroot}%{_unitdir}/nfs-ganesha.service
c99586
 %if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 8 )
c99586
 install -m 644 scripts/systemd/nfs-ganesha-lock.service.el8	%{buildroot}%{_unitdir}/nfs-ganesha-lock.service
c99586
-install -m 644 scripts/systemd/rpc-statd.conf.el8	%{buildroot}%{_sysconfdir}/systemd/system/nfs-ganesha.d/rpc-statd.conf
c99586
+install -m 644 scripts/systemd/rpc-statd.conf.el8	%{buildroot}%{_sysconfdir}/systemd/system/nfs-ganesha-lock.service.d/rpc-statd.conf
c99586
 %else
c99586
 install -m 644 scripts/systemd/nfs-ganesha-lock.service.el7	%{buildroot}%{_unitdir}/nfs-ganesha-lock.service
c99586
 %endif
c99586
@@ -677,7 +677,7 @@ exit 0
c99586
 %{_unitdir}/nfs-ganesha-lock.service
c99586
 %{_unitdir}/nfs-ganesha-config.service
c99586
 %if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 8 )
c99586
-%{_sysconfdir}/systemd/system/nfs-ganesha.d/rpc-statd.conf
c99586
+%{_sysconfdir}/systemd/system/nfs-ganesha-lock.service.d/rpc-statd.conf
c99586
 %endif
c99586
 
c99586
 %if %{with man_page}
c99586
diff --git a/src/scripts/systemd/nfs-ganesha-lock.service.debian10 b/src/scripts/systemd/nfs-ganesha-lock.service.debian10
c99586
index 67af058fe..da06ef4fe 100644
c99586
--- a/src/scripts/systemd/nfs-ganesha-lock.service.debian10
c99586
+++ b/src/scripts/systemd/nfs-ganesha-lock.service.debian10
c99586
@@ -17,7 +17,7 @@
c99586
 
c99586
 [Unit]
c99586
 Before=nfs-ganesha.service
c99586
-Conflicts=nfs-lock.service rpc-statd.service
c99586
+Conflicts=nfs-lock.service
c99586
 
c99586
 [Service]
c99586
 ExecStartPre=
c99586
diff --git a/src/scripts/systemd/nfs-ganesha-lock.service.el8 b/src/scripts/systemd/nfs-ganesha-lock.service.el8
c99586
index 67af058fe..da06ef4fe 100644
c99586
--- a/src/scripts/systemd/nfs-ganesha-lock.service.el8
c99586
+++ b/src/scripts/systemd/nfs-ganesha-lock.service.el8
c99586
@@ -17,7 +17,7 @@
c99586
 
c99586
 [Unit]
c99586
 Before=nfs-ganesha.service
c99586
-Conflicts=nfs-lock.service rpc-statd.service
c99586
+Conflicts=nfs-lock.service
c99586
 
c99586
 [Service]
c99586
 ExecStartPre=
c99586
diff --git a/src/scripts/systemd/rpc-statd.conf.debian10 b/src/scripts/systemd/rpc-statd.conf.debian10
c99586
index 2138f7467..d06fffd4c 100644
c99586
--- a/src/scripts/systemd/rpc-statd.conf.debian10
c99586
+++ b/src/scripts/systemd/rpc-statd.conf.debian10
c99586
@@ -13,7 +13,7 @@ After=nfs-config.service
c99586
 [Service]
c99586
 EnvironmentFile=-/run/sysconfig/nfs-utils
c99586
 Type=forking
c99586
-PIDFile=/var/run/rpc.statd.pid
c99586
+PIDFile=/run/rpc.statd.pid
c99586
 ExecStart=/sbin/rpc.statd --no-notify $STATDARGS
c99586
 
c99586
 [Install]
c99586
diff --git a/src/scripts/systemd/rpc-statd.conf.el8 b/src/scripts/systemd/rpc-statd.conf.el8
c99586
index 6fec09af1..b67cfdf24 100644
c99586
--- a/src/scripts/systemd/rpc-statd.conf.el8
c99586
+++ b/src/scripts/systemd/rpc-statd.conf.el8
c99586
@@ -1,3 +1,4 @@
c99586
+[Unit]
c99586
 Description=NFS status monitor for NFSv2/3 locking.
c99586
 DefaultDependencies=no
c99586
 Conflicts=umount.target
c99586
@@ -10,5 +11,5 @@
c99586
 [Service]
c99586
 Environment=RPC_STATD_NO_NOTIFY=1
c99586
 Type=forking
c99586
-PIDFile=/var/run/rpc.statd.pid
c99586
+PIDFile=/run/rpc.statd.pid
c99586
 ExecStart=/usr/sbin/rpc.statd
c99586
-- 
c99586
2.26.2
c99586