From be1e909e1dfb8673b7fba2c3ec32d67c459f9dbf Mon Sep 17 00:00:00 2001 From: Shuicheng Lin Date: Fri, 30 Nov 2018 20:09:22 +0800 Subject: [PATCH] refactor nfs-utils Story: 2004404 Task: 28046 since there is no src patch, move the meta patch setting to config package. And replace srpm with rpm. The 4 service files(rpc-statd/rpc-statd-notify) from nfs-utils are kept to avoid rpm audit complain. Just disable them by default. The service/conf files in files folder are not used, so just remove them. Test: Pass build and multi node deploy test. Confirmed The 4 services are disabled. Other services are the same as before. Change-Id: I42d2ef3d61c1f62fe8aaea5467c810fc6e39dc13 Signed-off-by: Shuicheng Lin --- centos_iso_image.inc | 3 +- centos_pkg_dirs | 1 - .../centos/nfs-utils-config.spec | 18 ++++++- filesystem/nfs-utils/centos/build_srpm.data | 2 - ...te-package-versioning-for-TIS-format.patch | 33 ------------ .../0001-add-rpm-4.14-compatibility.patch | 33 ------------ .../nfs-utils/centos/meta_patches/PATCH_ORDER | 4 -- ...tils-spec-file-disable-statd-service.patch | 50 ------------------- .../spec-include-TiS-changes.patch | 26 ---------- filesystem/nfs-utils/centos/srpm_path | 1 - filesystem/nfs-utils/files/nfs-mountd.service | 11 ---- filesystem/nfs-utils/files/nfs-server.service | 18 ------- filesystem/nfs-utils/files/nfs-statd.service | 12 ----- filesystem/nfs-utils/files/nfs-utils.conf | 35 ------------- 14 files changed, 17 insertions(+), 230 deletions(-) delete mode 100644 filesystem/nfs-utils/centos/build_srpm.data delete mode 100644 filesystem/nfs-utils/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch delete mode 100644 filesystem/nfs-utils/centos/meta_patches/0001-add-rpm-4.14-compatibility.patch delete mode 100644 filesystem/nfs-utils/centos/meta_patches/PATCH_ORDER delete mode 100644 filesystem/nfs-utils/centos/meta_patches/nfs-utils-spec-file-disable-statd-service.patch delete mode 100644 filesystem/nfs-utils/centos/meta_patches/spec-include-TiS-changes.patch delete mode 100644 filesystem/nfs-utils/centos/srpm_path delete mode 100644 filesystem/nfs-utils/files/nfs-mountd.service delete mode 100644 filesystem/nfs-utils/files/nfs-server.service delete mode 100644 filesystem/nfs-utils/files/nfs-statd.service delete mode 100644 filesystem/nfs-utils/files/nfs-utils.conf diff --git a/centos_iso_image.inc b/centos_iso_image.inc index bf26cf263..71ce5fffe 100644 --- a/centos_iso_image.inc +++ b/centos_iso_image.inc @@ -176,8 +176,7 @@ nss-pam-ldapd # centos-release-config centos-release-config -# nfs-utils -nfs-utils +# nfs-utils series package nfs-utils-config # dhcp diff --git a/centos_pkg_dirs b/centos_pkg_dirs index 443ab6577..21613eb8e 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -5,7 +5,6 @@ base/setup-config base/setup utilities/namespace-utils base/centos-release-config -filesystem/nfs-utils filesystem/nfs-utils-config base/dhcp base/dhcp-config diff --git a/filesystem/nfs-utils-config/centos/nfs-utils-config.spec b/filesystem/nfs-utils-config/centos/nfs-utils-config.spec index 4f5a8c386..6d23719f1 100644 --- a/filesystem/nfs-utils-config/centos/nfs-utils-config.spec +++ b/filesystem/nfs-utils-config/centos/nfs-utils-config.spec @@ -36,8 +36,22 @@ if [ $1 -eq 1 ] ; then cp -f %{_datadir}/starlingx/stx.nfsmount.conf %{_sysconfdir}/nfsmount.conf chmod 644 %{_sysconfdir}/nfsmount.conf fi -/bin/systemctl enable nfscommon.service >/dev/null 2>&1 || : -/bin/systemctl enable nfsserver.service >/dev/null 2>&1 || : +# STX - disable these service files as rpc-statd is started by nfscommon +%{_bindir}/systemctl disable rpc-statd.service +%{_bindir}/systemctl disable rpc-statd-notify.service +%{_bindir}/systemctl disable nfs-lock.service +%{_bindir}/systemctl disable nfslock.service + +%{_bindir}/systemctl enable nfscommon.service >/dev/null 2>&1 || : +%{_bindir}/systemctl enable nfsserver.service >/dev/null 2>&1 || : + +%preun +if [ $1 -eq 0 ]; then + # pre uninstall + %{_bindir}/systemctl disable nfscommon.service >/dev/null 2>&1 || : + %{_bindir}/systemctl disable nfsserver.service >/dev/null 2>&1 || : +fi + %files %defattr(-,root,root,-) diff --git a/filesystem/nfs-utils/centos/build_srpm.data b/filesystem/nfs-utils/centos/build_srpm.data deleted file mode 100644 index d6df555cd..000000000 --- a/filesystem/nfs-utils/centos/build_srpm.data +++ /dev/null @@ -1,2 +0,0 @@ -COPY_LIST="files/*" -TIS_PATCH_VER=4 diff --git a/filesystem/nfs-utils/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/filesystem/nfs-utils/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch deleted file mode 100644 index 8bebfe486..000000000 --- a/filesystem/nfs-utils/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 182dd62962039d383c96d7a50779aefb62cac9a0 Mon Sep 17 00:00:00 2001 -From: Scott Little -Date: Mon, 15 Oct 2018 23:17:14 +0800 -Subject: [PATCH] WRS: 0001-Update-package-versioning-for-TIS-format.patch - ---- - SPECS/nfs-utils.spec | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/SPECS/nfs-utils.spec b/SPECS/nfs-utils.spec -index d10c87c..b866788 100644 ---- a/SPECS/nfs-utils.spec -+++ b/SPECS/nfs-utils.spec -@@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser - Name: nfs-utils - URL: http://sourceforge.net/projects/nfs - Version: 1.3.0 --Release: 0.54%{?dist} -+Release: 0.54.el7%{?_tis_dist}.%{tis_patch_ver} - Epoch: 1 - - # group all 32bit related archs -@@ -155,6 +155,7 @@ Provides: rpc.mountd = %{epoch}:%{version}-%{release} - Provides: rpc.nfsd = %{epoch}:%{version}-%{release} - Provides: rpc.statd = %{epoch}:%{version}-%{release} - Provides: rpc.gssd = %{epoch}:%{version}-%{release} -+Provides: rpc.svcgssd = %{epoch}:%{version}-%{release} - Provides: mount.nfs = %{epoch}:%{version}-%{release} - Provides: mount.nfs4 = %{epoch}:%{version}-%{release} - Provides: umount.nfs = %{epoch}:%{version}-%{release} --- -2.7.4 - diff --git a/filesystem/nfs-utils/centos/meta_patches/0001-add-rpm-4.14-compatibility.patch b/filesystem/nfs-utils/centos/meta_patches/0001-add-rpm-4.14-compatibility.patch deleted file mode 100644 index e5c49bde0..000000000 --- a/filesystem/nfs-utils/centos/meta_patches/0001-add-rpm-4.14-compatibility.patch +++ /dev/null @@ -1,33 +0,0 @@ -From feb40bdf71992f9374e82aeb081431d2b91f1224 Mon Sep 17 00:00:00 2001 -From: slin14 -Date: Mon, 15 Oct 2018 23:21:15 +0800 -Subject: [PATCH] add-rpm-4.14-compatibility - -Signed-off-by: slin14 ---- - SPECS/nfs-utils.spec | 9 +-------- - 1 file changed, 1 insertion(+), 8 deletions(-) - -diff --git a/SPECS/nfs-utils.spec b/SPECS/nfs-utils.spec -index b866788..96fce13 100644 ---- a/SPECS/nfs-utils.spec -+++ b/SPECS/nfs-utils.spec -@@ -610,14 +610,7 @@ if [ -h /etc/systemd/system/multi-user.target.wants/nfs.target ]; then - fi - fi - --%triggerun -- nfs-utils < 1:1.2.9-0.5 --/bin/systemctl stop nfs-secure.service >/dev/null 2>&1 || : --/bin/systemctl disable nfs-secure.service >/dev/null 2>&1 || : -- --%triggerun -- nfs-utils < 1:1.2.4-2 --/bin/systemctl enable nfs-lock.service >/dev/null 2>&1 || : -- --%triggerin -- nfs-utils > 1:1.3.0-0.39 -+%triggerin -- nfs-utils - # reset configuration files and running daemons - if [ $1 -eq 2 ] ; then - /bin/systemctl enable nfs-client.target >/dev/null 2>&1 || : --- -2.7.4 - diff --git a/filesystem/nfs-utils/centos/meta_patches/PATCH_ORDER b/filesystem/nfs-utils/centos/meta_patches/PATCH_ORDER deleted file mode 100644 index 0f4667c8b..000000000 --- a/filesystem/nfs-utils/centos/meta_patches/PATCH_ORDER +++ /dev/null @@ -1,4 +0,0 @@ -spec-include-TiS-changes.patch -nfs-utils-spec-file-disable-statd-service.patch -0001-Update-package-versioning-for-TIS-format.patch -0001-add-rpm-4.14-compatibility.patch diff --git a/filesystem/nfs-utils/centos/meta_patches/nfs-utils-spec-file-disable-statd-service.patch b/filesystem/nfs-utils/centos/meta_patches/nfs-utils-spec-file-disable-statd-service.patch deleted file mode 100644 index 6f2e5d0dc..000000000 --- a/filesystem/nfs-utils/centos/meta_patches/nfs-utils-spec-file-disable-statd-service.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 81d1abb89facf77ad3b1fade4384ccf3b0482eb3 Mon Sep 17 00:00:00 2001 -From: Scott Little -Date: Mon, 15 Oct 2018 23:14:20 +0800 -Subject: WRS: nfs-utils-spec-file-disable-statd-service.patch - ---- - SPECS/nfs-utils.spec | 13 ++++++++++--- - 1 file changed, 10 insertions(+), 3 deletions(-) - -diff --git a/SPECS/nfs-utils.spec b/SPECS/nfs-utils.spec -index 0a5e9fb..d10c87c 100644 ---- a/SPECS/nfs-utils.spec -+++ b/SPECS/nfs-utils.spec -@@ -472,6 +472,10 @@ rm $RPM_BUILD_ROOT%{_sbindir}/rpc.svcgssd - rm $RPM_BUILD_ROOT%{_mandir}/man8/rpc.svcgssd.8 - rm $RPM_BUILD_ROOT%{_mandir}/man8/svcgssd.8 - -+# WRS - remove these service files as rpc-statd is started by nfscommon -+rm -f $RPM_BUILD_ROOT%{_unitdir}/rpc-statd.service -+rm -f $RPM_BUILD_ROOT%{_unitdir}/rpc-statd-notify.service -+ - mkdir -p $RPM_BUILD_ROOT/run/sysconfig - mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/scripts - mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gssproxy -@@ -488,9 +492,6 @@ ln -s rpc-gssd.service nfs-secure.service - ln -s rpc-gssd.service rpcgssd.service - ln -s nfs-idmapd.service nfs-idmap.service - ln -s nfs-idmapd.service rpcidmapd.service --ln -s rpc-statd.service nfs-lock.service --ln -s rpc-statd.service nfslock.service -- - - mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/nfs/rpc_pipefs - -@@ -555,6 +556,12 @@ fi - %post - if [ $1 -eq 1 ] ; then - # Initial installation -+ if [ -f %{_unitdir}/rpc-statd.service ] ; then -+ rm -f %{_unitdir}/rpc-statd.service -+ fi -+ if [ -f %{_unitdir}/rpc-statd-notify.service ] ; then -+ rm -f %{_unitdir}/rpc-statd-notify.service -+ fi - /bin/systemctl enable nfs-client.target >/dev/null 2>&1 || : - /bin/systemctl restart nfs-config >/dev/null 2>&1 || : - fi --- -2.7.4 - diff --git a/filesystem/nfs-utils/centos/meta_patches/spec-include-TiS-changes.patch b/filesystem/nfs-utils/centos/meta_patches/spec-include-TiS-changes.patch deleted file mode 100644 index 46dbf9013..000000000 --- a/filesystem/nfs-utils/centos/meta_patches/spec-include-TiS-changes.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 68ed40412a6a5caa0474715363a06914819b50bf Mon Sep 17 00:00:00 2001 -From: Scott Little -Date: Mon, 15 Oct 2018 22:50:46 +0800 -Subject: [PATCH] WRS: spec-include-TiS-changes.patch - ---- - SPECS/nfs-utils.spec | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/SPECS/nfs-utils.spec b/SPECS/nfs-utils.spec -index 6dfddc0..0a5e9fb 100644 ---- a/SPECS/nfs-utils.spec -+++ b/SPECS/nfs-utils.spec -@@ -569,6 +569,9 @@ if [ $1 -eq 0 ]; then - %systemd_preun nfs-client.target - %systemd_preun nfs-server.server - -+ /bin/systemctl disable nfscommon.service >/dev/null 2>&1 || : -+ /bin/systemctl disable nfsserver.service >/dev/null 2>&1 || : -+ - /usr/sbin/userdel rpcuser 2>/dev/null || : - /usr/sbin/groupdel rpcuser 2>/dev/null || : - /usr/sbin/userdel nfsnobody 2>/dev/null || : --- -2.7.4 - diff --git a/filesystem/nfs-utils/centos/srpm_path b/filesystem/nfs-utils/centos/srpm_path deleted file mode 100644 index 9e8d67122..000000000 --- a/filesystem/nfs-utils/centos/srpm_path +++ /dev/null @@ -1 +0,0 @@ -mirror:Source/nfs-utils-1.3.0-0.54.el7.src.rpm diff --git a/filesystem/nfs-utils/files/nfs-mountd.service b/filesystem/nfs-utils/files/nfs-mountd.service deleted file mode 100644 index 613ddc003..000000000 --- a/filesystem/nfs-utils/files/nfs-mountd.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=NFS Mount Daemon -After=rpcbind.service nfs-server.service -Requires=rpcbind.service nfs-server.service - -[Service] -EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf -ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS - -[Install] -WantedBy=multi-user.target diff --git a/filesystem/nfs-utils/files/nfs-server.service b/filesystem/nfs-utils/files/nfs-server.service deleted file mode 100644 index 147d7a7b5..000000000 --- a/filesystem/nfs-utils/files/nfs-server.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=NFS Server -Requires=rpcbind.service nfs-mountd.service -After=rpcbind.service - -[Service] -Type=oneshot -EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf -ExecStartPre=@SBINDIR@/exportfs -r -ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT -ExecStop=@SBINDIR@/rpc.nfsd 0 -ExecStopPost=@SBINDIR@/exportfs -f -ExecReload=@SBINDIR@/exportfs -r -StandardError=syslog -RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target diff --git a/filesystem/nfs-utils/files/nfs-statd.service b/filesystem/nfs-utils/files/nfs-statd.service deleted file mode 100644 index 746dacf05..000000000 --- a/filesystem/nfs-utils/files/nfs-statd.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=NFS file locking service -After=rpcbind.service -Requires=rpcbind.service -Before=remote-fs-pre.target - -[Service] -EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf -ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS - -[Install] -WantedBy=multi-user.target diff --git a/filesystem/nfs-utils/files/nfs-utils.conf b/filesystem/nfs-utils/files/nfs-utils.conf deleted file mode 100644 index a1007a7fb..000000000 --- a/filesystem/nfs-utils/files/nfs-utils.conf +++ /dev/null @@ -1,35 +0,0 @@ -# Parameters to be passed to nfs-utils (clients & server) service files. -# - -# Options to pass to rpc.nfsd. -NFSD_OPTS="" - -# Number of servers to start up; the default is 8 servers. -NFSD_COUNT="" - -# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd". -PROCNFSD_MOUNTPOINT="" - -# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid". -PROCNFSD_MOUNTOPTS="" - -# Options for rpc.mountd. -# If you have a port-based firewall, you might want to set up -# a fixed port here using the --port option. -MOUNTD_OPTS="" - -# Parameters to be passed to nfs-common (nfs clients & server) init script. -# - -# If you do not set values for the NEED_ options, they will be attempted -# autodetected; this should be sufficient for most people. Valid alternatives -# for the NEED_ options are "yes" and "no". - -# Do you want to start the statd daemon? It is not needed for NFSv4. -NEED_STATD="" - -# Options to pass to rpc.statd. -# N.B. statd normally runs on both client and server, and run-time -# options should be specified accordingly. -# STATD_OPTS="-p 32765 -o 32766" -STATD_OPTS=""