From: Yu Jian Date: Mon, 16 Jul 2012 03:40:05 +0000 (+0800) Subject: LU-1471 tests: check rpcidmapd service in setup-nfs.sh X-Git-Tag: 2.2.92~28 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=ff6994ecfeaf206f259fc2de2393b89e28140fc0 LU-1471 tests: check rpcidmapd service in setup-nfs.sh The rpcidmapd system service is not in SLES11 distro, which caused "service: no such service rpcidmapd" error while running setup-nfs.sh. This patch fixes the above issue by checking the service before restarting or stopping it. Test-Parameters: testlist=parallel-scale-nfsv3,parallel-scale-nfsv4 Signed-off-by: Yu Jian Change-Id: I0571d9ce3850fda246c1cd43b6c9019de30398e1 Reviewed-on: http://review.whamcloud.com/3400 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Wei Liu Reviewed-by: Minh Diep Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/setup-nfs.sh b/lustre/tests/setup-nfs.sh index 7863d40..218eb58 100755 --- a/lustre/tests/setup-nfs.sh +++ b/lustre/tests/setup-nfs.sh @@ -23,7 +23,9 @@ setup_nfs() { do_nodes $LUSTRE_CLIENT "service nfs restart" || return 1 - do_nodes $NFS_CLIENTS "service rpcidmapd restart" || return 1 + do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null | + grep -q rpcidmapd && service rpcidmapd restart || + true" do_nodes $LUSTRE_CLIENT "exportfs -o $export_opts_v *:$MNTPNT \ && exportfs -v" || return 1 @@ -50,8 +52,10 @@ cleanup_nfs() { echo -e "\nUnmounting NFS clients..." do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || return 1 - echo -e "\nUnexporting Lustre filesystem..." - do_nodes $NFS_CLIENTS "service rpcidmapd stop" || return 1 + echo -e "\nUnexporting Lustre filesystem..." + do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null | + grep -q rpcidmapd && service rpcidmapd stop || + true" do_nodes $LUSTRE_CLIENT "service nfs stop" || return 1