2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 05:47:59 +00:00

Fix return code propogation in the initscripts, and return the

correct return code in the try-restart case properly when apparmor is
not loaded.
This commit is contained in:
Steve Beattie 2007-05-24 05:00:34 +00:00
parent 703cad6072
commit c2d927e710
7 changed files with 38 additions and 8 deletions

View File

@ -112,13 +112,16 @@ fi
case "$1" in
start)
start_aa_event
rc=$?
;;
stop)
stop_aa_event
rc=$?
;;
restart|reload|force-reload|try-restart)
stop_aa_event
start_aa_event
rc=$?
;;
status)
echo -n "Checking for service AppArmor Event daemon:"
@ -134,4 +137,4 @@ case "$1" in
exit 1
;;
esac
exit 0
exit $rc

View File

@ -107,13 +107,16 @@ fi
case "$1" in
start)
start_aa_event
rc=$?
;;
stop)
stop_aa_event
rc=$?
;;
restart|reload|force-reload|try-restart)
stop_aa_event
start_aa_event
rc=$?
;;
status)
echo -n "Checking for service AppArmor Event daemon:"
@ -129,5 +132,5 @@ case "$1" in
exit 1
;;
esac
exit 0
exit $rc

View File

@ -90,25 +90,31 @@ test -x ${PARSER} || exit 0 # by debian policy
case "$1" in
start)
apparmor_start
rc=$?
;;
stop)
apparmor_stop
rc=$?
;;
restart|reload|force-reload)
apparmor_restart
rc=$?
;;
try-restart)
apparmor_try_restart
rc=$?
;;
kill)
apparmor_kill
rc=$?
;;
status)
apparmor_status
rc=$?
;;
*)
usage
exit 1
;;
esac
exit 0
exit $rc

View File

@ -422,7 +422,7 @@ apparmor_restart() {
apparmor_try_restart() {
if ! is_apparmor_loaded ; then
return 1
return 0
fi
__apparmor_restart

View File

@ -97,26 +97,32 @@ fi
case "$1" in
start)
apparmor_start
rc=$?
;;
stop)
apparmor_stop
rc=$?
;;
restart|reload|force-reload)
apparmor_restart
rc=$?
;;
try-restart)
apparmor_try_restart
rc=$?
;;
kill)
apparmor_kill
rc=$?
;;
status)
apparmor_status
rc=$?
;;
*)
usage
exit 1
;;
esac
exit 0
exit $rc

View File

@ -71,26 +71,32 @@ fi
case "$1" in
start)
apparmor_start
rc=$?
;;
stop)
apparmor_stop
rc=$?
;;
restart|reload|force-reload)
apparmor_restart
rc=$?
;;
try-restart)
apparmor_try_restart
rc=$?
;;
kill)
apparmor_kill
rc=$?
;;
status)
apparmor_status
rc=$?
;;
*)
usage
exit 1
;;
esac
exit 0
exit $rc

View File

@ -32,7 +32,7 @@
### BEGIN INIT INFO
# Provides: apparmor
# Required-Start:
# Rquired-Stop:
# Required-Stop:
# Should-Start: $local_fs
# Default-Start: B 2 3 5
# Default-Stop:
@ -99,26 +99,32 @@ fi
case "$1" in
start)
apparmor_start
rc=$?
;;
stop)
apparmor_stop
rc=$?
;;
restart|reload|force-reload)
apparmor_restart
rc=$?
;;
try-restart)
apparmor_try_restart
rc=$?
;;
kill)
apparmor_kill
rc=$?
;;
status)
apparmor_status
rc=$?
;;
*)
usage
exit 1
;;
esac
exit 0
exit $rc