-#!/bin/sh
+#!/bin/bash
# chkconfig: 2345 01 99
# description: AppArmor rc file. This rc script inserts the apparmor \
# module and runs the parser on the /etc/apparmor.d/ \
# Source function library
. /etc/rc.d/init.d/functions
-usage() {
- echo "Usage: $0 {start|stop|restart|try-restart|reload|force-reload|status|kill}"
+aa_log_skipped_msg() {
+ busy
+ fail
+ [ -n "$*" ] && echo "$*"
}
-
-sd_log_skipped_msg() {
- echo -n "$*"
- #success
- echo
-}
-sd_log_success_msg() {
- echo -n "$*"
- #success
- echo
+aa_log_success_msg() {
+ busy
+ ok
+ [ -n "$*" ] && echo "$*"
}
-sd_log_warning_msg() {
- echo -n "$*"
- #warning
- echo
+aa_log_warning_msg() {
+ busy
+ fail
+ [ -n "$*" ] && echo "$*"
}
-sd_log_failure_msg() {
- echo -n "$*"
- #failure
- echo
+aa_log_failure_msg() {
+ busy
+ fail
+ [ -n "$*" ] && echo "$*"
}
-sd_action() {
+aa_action() {
STRING=$1
shift
run_cmd "$STRING" "$@"
return $?
}
-. /etc/apparmor/rc.apparmor.functions
+# new in 2.5 (some broken)
+aa_log_action_begin() {
+ :
+}
+
+aa_log_action_start() {
+ :
+}
+
+aa_log_action_end() {
+ :
+}
+
+aa_log_daemon_msg() {
+ :
+}
+
+aa_log_end_msg() {
+ :
+}
+
+log_end_msg() {
+ aa_log_end_msg $*
+}
+
+. /lib/apparmor/rc.apparmor.functions
+RETVAL=0
case "$1" in
- start)
- subdomain_start
- ;;
- stop)
- subdomain_stop
- ;;
- restart|reload|force-reload)
- subdomain_restart
- ;;
- try-restart)
- subdomain_try_restart
- ;;
- debug)
- subdomain_debug
- ;;
- kill)
- subdomain_kill
- ;;
- status)
- subdomain_status
- ;;
- *)
- usage
- exit 1
- esac
-exit 0
+start)
+ msg_starting apparmor
+ started
+ apparmor_start
+ ;;
+stop)
+ msg_stopping apparmor
+ started
+ apparmor_stop
+ ;;
+restart|reload|force-reload)
+ msg_reloading apparmor
+ started
+ apparmor_restart
+ ;;
+try-restart)
+ msg_reloading
+ started
+ apparmor_try_restart
+ ;;
+debug)
+ apparmor_debug
+ ;;
+kill)
+ apparmor_kill
+ ;;
+status)
+ apparmor_status
+ ;;
+*)
+ msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status|kill}"
+ exit 3
+esac
+exit $RETVAL