[apparmor] [patch] initscript changes (apparmor-scripts)

Christian Boltz apparmor at cboltz.de
Mon Aug 8 21:53:16 UTC 2011


Hello,

the next openSUSE patch includes some changes in the initscripts.


Regards,

Christian Boltz
-- 
Windows hatte für mich auch etwas gutes ...

... Microsoft schaffte es zumindest mein Interesse an Linux
zu wecken ;-)                 [Michael Meyer in suse-linux]
-------------- next part --------------
---

 parser/rc.aaeventd.suse      |    2 +-
 parser/rc.apparmor.functions |    9 ++++-----
 parser/rc.apparmor.suse      |   23 ++++++++++++++++++++++-
 3 files changed, 27 insertions(+), 7 deletions(-)

--- a/parser/rc.aaeventd.suse
+++ b/parser/rc.aaeventd.suse
@@ -27,7 +27,7 @@
 ### BEGIN INIT INFO
 # Provides: aaeventd
 # Required-Start: apparmor
-# Required-Stop:
+# Required-Stop: $null
 # Default-Start: 2 3 5
 # Default-Stop:
 # Short-Description: AppArmor Notification and Reporting
--- a/parser/rc.apparmor.functions
+++ b/parser/rc.apparmor.functions
@@ -108,9 +108,7 @@ is_apparmor_present() {
 	# check for subdomainfs version of module
 	grep -qE "^($modules)[[:space:]]" /proc/modules
 
-	if [ $? -ne 0 ] ; then
-		ls /sys/module/apparmor 2>/dev/null | grep -qE "^($modules)"
-	fi
+	[ $? -ne 0 -a -d /sys/module/apparmor ]
 
 	return $?
 }
@@ -377,10 +375,11 @@ apparmor_start() {
 	configure_owlsm
 
 	# if there is anything in the profiles file don't load
-	cat "$SFS_MOUNTPOINT/profiles" | if ! read line ; then
+	if ! read line < "$SFS_MOUNTPOINT/profiles"; then
 		parse_profiles load
 	else
-		aa_log_skipped_msg "AppArmor already loaded with profiles."
+		aa_log_skipped_msg ": already loaded with profiles."
+		return 0
 	fi
 	aa_log_end_msg 0
 	return 0
--- a/parser/rc.apparmor.suse
+++ b/parser/rc.apparmor.suse
@@ -31,6 +31,7 @@
 # Required-Start: boot.cleanup
 # Required-Stop: $null
 # Should-Start: $local_fs
+# Should-Stop: $null
 # Default-Start: B
 # Default-Stop:
 # Short-Description: AppArmor initialization
@@ -73,7 +74,19 @@ aa_log_warning_msg() {
 }
 
 aa_log_failure_msg() {
-	log_failure_msg $*
+	log_failure_msg '\n'$*
+}
+
+aa_log_action_begin() {
+	echo -n
+}
+
+aa_log_action_end() {
+	echo -n
+}
+
+aa_log_daemon_msg() {
+	echo -en "$@ "
 }
 
 aa_log_skipped_msg() {
@@ -81,6 +94,14 @@ aa_log_skipped_msg() {
 	echo -e	"$rc_skipped"
 }
 
+aa_log_end_msg() {
+	v="-v"
+	if [ "$1" != '0' ]; then
+		rc="-v$1"
+	fi
+	rc_status $v
+}
+
 usage() {
     echo "Usage: $0 {start|stop|restart|try-restart|reload|force-reload|status|kill}"
 }


More information about the AppArmor mailing list