From: Martin Schwenke Date: Thu, 17 Mar 2022 23:41:26 +0000 (+1100) Subject: ctdb-scripts: Simplify and rename basic_stop() and basic_start() X-Git-Tag: tevent-0.13.0~330 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd018d0ff5c57ccd50f64fd0ed1591e3dfe27baf;p=thirdparty%2Fsamba.git ctdb-scripts: Simplify and rename basic_stop() and basic_start() Drop the argument. These now just stop/start the overall NFS service, so rename them appropriately. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/nfs-linux-kernel-callout b/ctdb/config/nfs-linux-kernel-callout index 963c8b5eca2..6e22548e7c8 100755 --- a/ctdb/config/nfs-linux-kernel-callout +++ b/ctdb/config/nfs-linux-kernel-callout @@ -107,46 +107,32 @@ nfs_load_config() } ################################################## -# Basic service stop and start +# Overall NFS service stop and start -basic_stop() +nfs_service_stop() { - case "$1" in - nfs) - if [ -n "$nfs_rquotad_service" ]; then - service "$nfs_rquotad_service" stop - fi + if [ -n "$nfs_rquotad_service" ]; then + service "$nfs_rquotad_service" stop + fi - service "$nfs_service" stop + service "$nfs_service" stop - if [ -n "$nfs_lock_service" ]; then - service "$nfs_lock_service" stop - fi - ;; - *) - usage - ;; - esac + if [ -n "$nfs_lock_service" ]; then + service "$nfs_lock_service" stop + fi } -basic_start() +nfs_service_start() { - case "$1" in - nfs) - if [ -n "$nfs_lock_service" ]; then - service "$nfs_lock_service" start - fi + if [ -n "$nfs_lock_service" ]; then + service "$nfs_lock_service" start + fi - service "$nfs_service" start + service "$nfs_service" start - if [ -n "$nfs_rquotad_service" ]; then - service "$nfs_rquotad_service" start - fi - ;; - *) - usage - ;; - esac + if [ -n "$nfs_rquotad_service" ]; then + service "$nfs_rquotad_service" start + fi } ################################################## @@ -157,7 +143,7 @@ service_stop() case "$1" in nfs) echo 0 >"${PROCFS_PATH}/fs/nfsd/threads" - basic_stop "nfs" >/dev/null 2>&1 || true + nfs_service_stop >/dev/null 2>&1 || true pkill -9 nfsd ;; nlockmgr) @@ -204,7 +190,7 @@ service_start() { case "$1" in nfs) - basic_start "nfs" + nfs_service_start ;; nlockmgr) if [ -n "$nfs_lock_service" ]; then @@ -274,13 +260,13 @@ service_start() nfs_shutdown() { - basic_stop "nfs" + nfs_service_stop } nfs_startup() { - basic_stop "nfs" || true - basic_start "nfs" + nfs_service_stop || true + nfs_service_start _f="${PROCFS_PATH}/sys/net/ipv4/tcp_tw_recycle" if [ -f "$_f" ]; then echo 1 >"$_f"