]> git.pld-linux.org Git - packages/audit.git/blobdiff - auditd.init
- updated to 3.1.2; flexible array workaround already in code
[packages/audit.git] / auditd.init
index 7a4c0903eb20db003524f50da209abdbe6ea810d..445342631ecbd0c7aaf1fb18c6d326f0ddff295e 100755 (executable)
@@ -2,12 +2,15 @@
 #
 # auditd       This starts and stops auditd
 #
-# chkconfig: 2345 18 87
-# description: This starts the Linux Auditing System Daemon
+# chkconfig: 2345 18 82
+# description: This starts the Linux Auditing System Daemon, \
+#              which collects security related events in a dedicated \
+#              audit log. If this daemon is turned off, audit events \
+#              will be sent to syslog.
 #
 # processname: auditd
 # config: /etc/sysconfig/auditd
-# config: /etc/auditd.conf
+# config: /etc/audit/auditd.conf
 # pidfile: /var/run/auditd.pid
 
 PATH=/sbin:/bin:/usr/bin:/usr/sbin
@@ -15,7 +18,8 @@ PATH=/sbin:/bin:/usr/bin:/usr/sbin
 # Source function library
 . /etc/rc.d/init.d/functions
 
-AUDITD_CLEAN_STOP=yes
+AUDITD_CLEAN_STOP="yes"
+AUDITD_STOP_DISABLE="yes"
 EXTRAOPTIONS=
 AUDIT_RULES=/etc/audit/audit.rules
 
@@ -30,11 +34,29 @@ start() {
 
        local rc
        msg_starting auditd
+       # Localization for auditd is controlled in /etc/synconfig/auditd
+       if [ -z "$AUDITD_LANG" -o "$AUDITD_LANG" = "C" -o "$AUDITD_LANG" = "none" -o "$AUDITD_LANG" = "NONE" ]; then
+               unset LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE
+       else
+               LANG="$AUDITD_LANG"
+               LC_TIME="$AUDITD_LANG"
+               LC_ALL="$AUDITD_LANG"
+               LC_MESSAGES="$AUDITD_LANG"
+               LC_NUMERIC="$AUDITD_LANG"
+               LC_MONETARY="$AUDITD_LANG"
+               LC_COLLATE="$AUDITD_LANG"
+               export LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE
+       fi
        unset HOME MAIL USER USERNAME
        daemon /sbin/auditd "$EXTRAOPTIONS"
        RETVAL=$?
        # Load the default rules if daemon started
        if [ $RETVAL -eq 0 ] && [ -f $AUDIT_RULES ]; then
+               # Prepare the default rules
+               if is_yes "$USE_AUGENRULES"; then
+                       /sbin/augenrules
+               fi
+               # Load the default rules
                /sbin/auditctl -R $AUDIT_RULES >/dev/null
                rc=$?
                # add error code, if it was an error
@@ -56,6 +78,9 @@ stop() {
        if ! is_no "$AUDITD_CLEAN_STOP"; then
                /sbin/auditctl -D >/dev/null
        fi
+       if ! is_no "$AUDITD_STOP_DISABLE"; then
+               /sbin/auditctl -e 0 >/dev/null
+       fi
 }
 
 condrestart() {
This page took 0.093381 seconds and 4 git commands to generate.