diff options
author | Eugeni Dodonov <eugeni@mandriva.org> | 2009-02-25 19:29:24 +0000 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.org> | 2009-02-25 19:29:24 +0000 |
commit | fb3973e7fcfd216f0fc1230dcbb2e4b310f20c46 (patch) | |
tree | 7d9c96e7b05006f15caee3323637fb76da78117a /msec.init | |
parent | a558cfa2010baae69c03e1f4b6aaa01b9dcd13a7 (diff) | |
download | msec-fb3973e7fcfd216f0fc1230dcbb2e4b310f20c46.tar msec-fb3973e7fcfd216f0fc1230dcbb2e4b310f20c46.tar.gz msec-fb3973e7fcfd216f0fc1230dcbb2e4b310f20c46.tar.bz2 msec-fb3973e7fcfd216f0fc1230dcbb2e4b310f20c46.tar.xz msec-fb3973e7fcfd216f0fc1230dcbb2e4b310f20c46.zip |
Added MSEC init script.
Diffstat (limited to 'msec.init')
-rwxr-xr-x | msec.init | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/msec.init b/msec.init new file mode 100755 index 0000000..399378c --- /dev/null +++ b/msec.init @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Enables MSEC policy on system startup +# +# description: Enables MSEC security policy on system startup +# chkconfig: 345 13 20 +# +### BEGIN INIT INFO +# Provides: msec +# Default-Start: 3 4 5 +# Short-Description: Enables MSEC security policy +# Description: Enables MSEC security settings, defined by current policy +### END INIT INFO + +# Source function library. +. /etc/rc.d/init.d/functions + +if [ ! -f /etc/security/msec/security.conf ] ; then + # no msec configuration, aborting + exit +fi + +. /etc/security/msec/security.conf + +# See how we were called. +case "$1" in + start) + if [ "$ENABLE_STARTUP_MSEC" = "yes" ]; then + gprintf "Enabling MSEC security policy" + /usr/sbin/msec -q + echo_success + fi + if [ "$ENABLE_STARTUP_PERMS" = "yes" ]; then + gprintf "Setting and checking MSEC permissions" + /usr/sbin/msecperms -q + echo_success + fi + ;; + stop) + # nothing to do + ;; + status) + if [ "$ENABLE_STARTUP_MSEC" = "yes" ]; then + gprintf "MSEC security policy on startup: enabled" + else + gprintf "MSEC security policy on startup: disabled" + fi + if [ "$ENABLE_STARTUP_PERMS" = "yes" ]; then + gprintf "MSEC permissions on startup: enabled" + else + gprintf "MSEC permissions on startup: disabled" + fi + ;; + restart) + $0 stop + $0 start + ;; + *) + gprintf "Usage: %s\n" "$0 {start|stop|restart|status}" + exit 1 +esac + +exit 0 |