1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

Eventscript functions: move flagging of managed services.

Move flagging of managed or unmanaged services into
ctdb_service_start() and ctdb_service_stop().  That way services will
be correctly flagged if they are started from the startup and shutdown
events.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8675744cbd90b5a5095ed6fff7b36ae82004a457)
This commit is contained in:
Martin Schwenke 2010-12-15 16:34:00 +11:00
parent 428e32d647
commit 5b5bd3d27b

View File

@ -715,22 +715,23 @@ ctdb_start_stop_service ()
if is_ctdb_managed_service "$_service_name" ; then
if ! is_ctdb_previously_managed_service "$_service_name" ; then
echo "Starting service $_service_name"
ctdb_service_start || exit $?
ctdb_service_managed "$_service_name"
exit 0
ctdb_service_start "$_service_name"
exit $?
fi
else
if is_ctdb_previously_managed_service "$_service_name" ; then
echo "Stopping service $_service_name"
ctdb_service_stop || exit $?
ctdb_service_unmanaged "$_service_name"
exit 0
ctdb_service_stop "$_service_name"
exit $?
fi
fi
}
ctdb_service_start ()
{
# The service is marked managed if we've ever tried to start it.
ctdb_service_managed "$@"
# Here we only want $1. If no argument is passed then
# service_start needs to know.
service_start "$@" || return $?
@ -740,6 +741,7 @@ ctdb_service_start ()
ctdb_service_stop ()
{
ctdb_service_unmanaged "$@"
service_stop "$@"
}