2006-04-11 21:52:54 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2006-04-12 03:09:10 +00:00
|
|
|
# $Id$
|
2006-04-11 21:52:54 +00:00
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------
|
2007-04-11 08:12:51 +00:00
|
|
|
# Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
|
|
|
# NOVELL (All rights reserved)
|
2006-04-11 21:52:54 +00:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of version 2 of the GNU General Public
|
|
|
|
# License published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, contact Novell, Inc.
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# rc.apparmor by Steve Beattie
|
|
|
|
#
|
|
|
|
# /etc/init.d/boot.apparmor
|
|
|
|
# and its symbolic link
|
|
|
|
# /sbin/rcapparmor
|
2007-03-26 20:52:45 +00:00
|
|
|
#
|
2006-04-11 21:52:54 +00:00
|
|
|
# chkconfig: 2345 01 99
|
|
|
|
# description: AppArmor rc file. This rc script inserts the apparmor \
|
|
|
|
# module and runs the parser on the /etc/apparmor.d/ \
|
|
|
|
# directory.
|
|
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: apparmor
|
2008-11-07 01:31:19 +00:00
|
|
|
# Required-Start:
|
2007-05-24 05:00:34 +00:00
|
|
|
# Required-Stop:
|
2006-10-31 15:33:10 +00:00
|
|
|
# Should-Start: $local_fs
|
2007-08-31 19:05:54 +00:00
|
|
|
# Default-Start: B
|
2007-03-26 20:52:45 +00:00
|
|
|
# Default-Stop:
|
2006-05-09 18:01:05 +00:00
|
|
|
# Short-Description: AppArmor initialization
|
2007-03-26 20:52:45 +00:00
|
|
|
# Description: AppArmor rc file. This rc script inserts the apparmor
|
2007-05-28 03:42:26 +00:00
|
|
|
# module and runs the parser on the /etc/apparmor.d/
|
|
|
|
# directory.
|
2006-04-11 21:52:54 +00:00
|
|
|
### END INIT INFO
|
|
|
|
APPARMOR_FUNCTIONS=/lib/apparmor/rc.apparmor.functions
|
|
|
|
|
|
|
|
# source function library
|
|
|
|
if [ -f /etc/init.d/functions ]; then
|
|
|
|
. /etc/init.d/functions
|
|
|
|
elif [ -f /etc/rc.d/init.d/functions ]; then
|
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
elif [ -f /lib/lsb/init-functions ]; then
|
|
|
|
. /lib/lsb/init-functions
|
|
|
|
else
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Ugh, SUSE doesn't implement action
|
2007-04-04 21:56:08 +00:00
|
|
|
aa_action() { STRING=$1
|
2006-04-11 21:52:54 +00:00
|
|
|
shift
|
|
|
|
"$@"
|
|
|
|
rc=$?
|
|
|
|
if [ $rc -eq 0 ] ; then
|
|
|
|
log_success_msg $"$STRING "
|
|
|
|
else
|
|
|
|
log_failure_msg $"$STRING "
|
|
|
|
fi
|
|
|
|
return $rc
|
|
|
|
}
|
|
|
|
|
2007-04-04 21:56:08 +00:00
|
|
|
aa_log_success_msg() {
|
2006-04-11 21:52:54 +00:00
|
|
|
log_success_msg $*
|
|
|
|
}
|
|
|
|
|
2007-04-04 21:56:08 +00:00
|
|
|
aa_log_warning_msg() {
|
2006-04-11 21:52:54 +00:00
|
|
|
log_warning_msg $*
|
|
|
|
}
|
|
|
|
|
2007-04-04 21:56:08 +00:00
|
|
|
aa_log_failure_msg() {
|
2006-04-11 21:52:54 +00:00
|
|
|
log_failure_msg $*
|
|
|
|
}
|
|
|
|
|
2007-04-04 21:56:08 +00:00
|
|
|
aa_log_skipped_msg() {
|
2006-08-04 17:16:47 +00:00
|
|
|
echo -en "$@"
|
|
|
|
echo -e "$rc_skipped"
|
|
|
|
}
|
|
|
|
|
2006-12-12 10:54:44 +00:00
|
|
|
usage() {
|
2006-04-11 21:52:54 +00:00
|
|
|
echo "Usage: $0 {start|stop|restart|try-restart|reload|force-reload|status|kill}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# source apparmor function library
|
|
|
|
if [ -f "${APPARMOR_FUNCTIONS}" ]; then
|
2006-12-12 10:54:44 +00:00
|
|
|
. ${APPARMOR_FUNCTIONS}
|
2006-04-11 21:52:54 +00:00
|
|
|
else
|
2007-04-04 21:56:08 +00:00
|
|
|
aa_log_failure_msg "Unable to find AppArmor initscript functions"
|
2006-04-11 21:52:54 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
2007-04-04 21:56:08 +00:00
|
|
|
apparmor_start
|
2007-05-24 05:00:34 +00:00
|
|
|
rc=$?
|
2006-04-11 21:52:54 +00:00
|
|
|
;;
|
|
|
|
stop)
|
2007-04-04 21:56:08 +00:00
|
|
|
apparmor_stop
|
2007-05-24 05:00:34 +00:00
|
|
|
rc=$?
|
2006-04-11 21:52:54 +00:00
|
|
|
;;
|
|
|
|
restart|reload|force-reload)
|
2007-04-04 21:56:08 +00:00
|
|
|
apparmor_restart
|
2007-05-24 05:00:34 +00:00
|
|
|
rc=$?
|
2006-04-11 21:52:54 +00:00
|
|
|
;;
|
|
|
|
try-restart)
|
2007-04-04 21:56:08 +00:00
|
|
|
apparmor_try_restart
|
2007-05-24 05:00:34 +00:00
|
|
|
rc=$?
|
2006-04-11 21:52:54 +00:00
|
|
|
;;
|
|
|
|
kill)
|
2007-04-04 21:56:08 +00:00
|
|
|
apparmor_kill
|
2007-05-24 05:00:34 +00:00
|
|
|
rc=$?
|
2006-04-11 21:52:54 +00:00
|
|
|
;;
|
|
|
|
status)
|
2007-04-04 21:56:08 +00:00
|
|
|
apparmor_status
|
2007-05-24 05:00:34 +00:00
|
|
|
rc=$?
|
2006-04-11 21:52:54 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
exit 1
|
2007-03-26 20:52:45 +00:00
|
|
|
;;
|
2006-04-11 21:52:54 +00:00
|
|
|
esac
|
2007-05-24 05:00:34 +00:00
|
|
|
exit $rc
|
2006-04-11 21:52:54 +00:00
|
|
|
|