2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 13:58:22 +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 case "$1" in
start) start)
start_aa_event start_aa_event
rc=$?
;; ;;
stop) stop)
stop_aa_event stop_aa_event
rc=$?
;; ;;
restart|reload|force-reload|try-restart) restart|reload|force-reload|try-restart)
stop_aa_event stop_aa_event
start_aa_event start_aa_event
rc=$?
;; ;;
status) status)
echo -n "Checking for service AppArmor Event daemon:" echo -n "Checking for service AppArmor Event daemon:"
@@ -134,4 +137,4 @@ case "$1" in
exit 1 exit 1
;; ;;
esac esac
exit 0 exit $rc

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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