From 45233d40873936e53b783b26bdb88a76bb2d46a5 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Wed, 10 Aug 2011 17:58:42 -0400 Subject: [PATCH] Fixed some bugs in the triggerun script as well in the nfs-server scripts (bz 699040). Signed-off-by: Steve Dickson --- nfs-server.preconfig | 1 + nfs-server.service | 4 ++-- nfs-utils.spec | 26 ++++++++++++++++++-------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/nfs-server.preconfig b/nfs-server.preconfig index d965dbe..a5e156d 100644 --- a/nfs-server.preconfig +++ b/nfs-server.preconfig @@ -4,6 +4,7 @@ # Set v4 grace period if requested if [ -n "$NFSD_V4_GRACE" ]; then + /sbin/modprobe -q nfsd echo "$NFSD_V4_GRACE" > /proc/fs/nfsd/nfsv4gracetime fi diff --git a/nfs-server.service b/nfs-server.service index 571b2e8..e126709 100644 --- a/nfs-server.service +++ b/nfs-server.service @@ -1,11 +1,11 @@ [Unit] -Description=NFS Protocol Daemon +Description=NFS Server After=network.target rpcbind.service [Service] Type=forking EnvironmentFile=-/etc/sysconfig/nfs -EnvironmentFile=/usr/lib/nfs-utils/scripts/nfs-server.preconfig +ExecStartPre=/usr/lib/nfs-utils/scripts/nfs-server.preconfig ExecStartPre=-/usr/sbin/rpc.rquotad $RPCRQUOTADOPTS ExecStartPre=/usr/sbin/exportfs -r ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS ${RPCNFSDCOUNT} diff --git a/nfs-utils.spec b/nfs-utils.spec index 27f7f78..1df6a18 100644 --- a/nfs-utils.spec +++ b/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.2.4 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 1 # group all 32bit related archs @@ -182,7 +182,6 @@ else fi %post - if [ $1 -eq 1 ]; then # Package install, not upgrade /bin/systemctl enable nfs-idmap.service >/dev/null 2>&1 || : @@ -192,8 +191,7 @@ fi chown -R rpcuser:rpcuser /var/lib/nfs/statd %preun - -if [ "$1" = "0" ]; then +if [ $1 -eq 0 ]; then # Package removal, not upgrade for service in %{nfs_services} ; do /bin/systemctl disable $service >/dev/null 2>&1 || : @@ -208,18 +206,26 @@ if [ "$1" = "0" ]; then fi %postun - -if [ "$1" -ge 1 ]; then +if [ $1 -ge 1 ]; then # Package upgrade, not uninstall for service in %{nfs_services} ; do + echo "try-restart $service service" /bin/systemctl try-restart $service >/dev/null 2>&1 || : done fi /bin/systemctl --system daemon-reload >/dev/null 2>&1 || : -%triggerun -- nfs < 1.2.4-4 +%triggerun -- nfs-utils < 1:1.2.4-2 +/bin/systemctl enable nfs-idmap.service >/dev/null 2>&1 || : +/bin/systemctl enable nfs-lock.service >/dev/null 2>&1 || : if /sbin/chkconfig --level 3 nfs ; then - /bin/systemctl --no-reload enable nfsserver.service >/dev/null 2>&1 || : + /bin/systemctl enable nfs-server.service >/dev/null 2>&1 || : +fi +if /sbin/chkconfig --level 3 rpcgssd ; then + /bin/systemctl enable nfs-secure.service >/dev/null 2>&1 || : +fi +if /sbin/chkconfig --level 3 rpcsvcgssd ; then + /bin/systemctl enable nfs-secure-server.service >/dev/null 2>&1 || : fi %files @@ -265,6 +271,10 @@ fi %attr(4755,root,root) /sbin/umount.nfs4 %changelog +* Wed Aug 10 2011 Steve Dickson 1.2.4-6 +- Fixed some bugs in the triggerun script as well in + the nfs-server scripts (bz 699040). + * Wed Aug 3 2011 Steve Dickson 1.2.4-5 - Cleaned up the .preconfig and .postconfig files per code review request.