mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
ctdb-scripts: Drop PID file argument from wrapper
Use the default compile-time PID file. Use a CTDB_PIDFILE environment variable when testing. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
b0d892b9ad
commit
52cdb03c65
@ -65,12 +65,12 @@ start()
|
||||
case "$CTDB_INIT_STYLE" in
|
||||
suse)
|
||||
startproc \
|
||||
"$ctdbd_wrapper" "$pidfile" "start"
|
||||
"$ctdbd_wrapper" "start"
|
||||
rc_status -v
|
||||
;;
|
||||
redhat)
|
||||
daemon --pidfile "$pidfile" \
|
||||
"$ctdbd_wrapper" "$pidfile" "start"
|
||||
"$ctdbd_wrapper" "start"
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1
|
||||
@ -78,7 +78,7 @@ start()
|
||||
;;
|
||||
debian)
|
||||
eval start-stop-daemon --start --quiet --background --exec \
|
||||
"$ctdbd_wrapper" "$pidfile" "start"
|
||||
"$ctdbd_wrapper" "start"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@ -89,11 +89,11 @@ stop()
|
||||
|
||||
case "$CTDB_INIT_STYLE" in
|
||||
suse)
|
||||
"$ctdbd_wrapper" "$pidfile" "stop"
|
||||
"$ctdbd_wrapper" "stop"
|
||||
rc_status -v
|
||||
;;
|
||||
redhat)
|
||||
"$ctdbd_wrapper" "$pidfile" "stop"
|
||||
"$ctdbd_wrapper" "stop"
|
||||
RETVAL=$?
|
||||
# Common idiom in Red Hat init scripts - success() always
|
||||
# succeeds so this does behave like if-then-else
|
||||
@ -104,7 +104,7 @@ stop()
|
||||
return $RETVAL
|
||||
;;
|
||||
debian)
|
||||
"$ctdbd_wrapper" "$pidfile" "stop"
|
||||
"$ctdbd_wrapper" "stop"
|
||||
log_end_msg $?
|
||||
;;
|
||||
esac
|
||||
|
@ -7,8 +7,8 @@ After=network-online.target time-sync.target
|
||||
Type=forking
|
||||
LimitCORE=infinity
|
||||
PIDFile=/run/ctdb/ctdbd.pid
|
||||
ExecStart=/usr/sbin/ctdbd_wrapper /run/ctdb/ctdbd.pid start
|
||||
ExecStop=/usr/sbin/ctdbd_wrapper /run/ctdb/ctdbd.pid stop
|
||||
ExecStart=/usr/sbin/ctdbd_wrapper start
|
||||
ExecStop=/usr/sbin/ctdbd_wrapper stop
|
||||
KillMode=control-group
|
||||
Restart=no
|
||||
|
||||
|
@ -4,14 +4,13 @@
|
||||
|
||||
usage ()
|
||||
{
|
||||
echo "usage: ctdbd_wrapper <pidfile> { start | stop }"
|
||||
echo "usage: ctdbd_wrapper { start | stop }"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ $# -eq 2 ] || usage
|
||||
[ $# -eq 1 ] || usage
|
||||
|
||||
pidfile="$1"
|
||||
action="$2"
|
||||
action="$1"
|
||||
|
||||
############################################################
|
||||
|
||||
@ -94,9 +93,8 @@ build_ctdb_options ()
|
||||
fi
|
||||
maybe_set "--reclock" "$CTDB_RECOVERY_LOCK"
|
||||
|
||||
maybe_set "--pidfile" "$pidfile"
|
||||
|
||||
# build up ctdb_options variable from optional parameters
|
||||
maybe_set "--pidfile" "$CTDB_PIDFILE"
|
||||
maybe_set "--logging" "$CTDB_LOGGING"
|
||||
maybe_set "--nlist" "$CTDB_NODES"
|
||||
maybe_set "--socket" "$CTDB_SOCKET"
|
||||
|
@ -201,12 +201,12 @@ start_ctdb_1 ()
|
||||
|
||||
CTDBD="${VALGRIND} ctdbd --sloppy-start --nopublicipcheck" \
|
||||
CTDBD_CONF="$conf" \
|
||||
ctdbd_wrapper "$pidfile" start
|
||||
CTDB_PIDFILE="$pidfile" \
|
||||
ctdbd_wrapper start
|
||||
|
||||
if [ -n "$tmp_conf" ] ; then
|
||||
rm -f "$tmp_conf"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
daemons_start ()
|
||||
@ -226,7 +226,8 @@ stop_ctdb_1 ()
|
||||
local conf=$(node_conf "$pnn")
|
||||
|
||||
CTDBD_CONF="$conf" \
|
||||
ctdbd_wrapper "$pidfile" stop
|
||||
CTDB_PIDFILE="$pidfile" \
|
||||
ctdbd_wrapper stop
|
||||
}
|
||||
|
||||
daemons_stop ()
|
||||
|
Loading…
Reference in New Issue
Block a user