3 # auditd This starts and stops auditd
5 # description: This starts the Linux Auditing System Daemon,
6 # which collects security related events in a dedicated
7 # audit log. If this daemon is turned off, audit events
8 # will be sent to syslog.
12 DAEMON
=/usr
/sbin
/${NAME}
13 CONFIG
=/etc
/audit
/auditd.conf
14 PIDFILE
=/var
/run
/${NAME}.pid
17 printf "Starting ${NAME}: "
19 # Create dir to store log files in if one doesn't exist. Create
20 # the directory with SELinux permissions if possible
21 command -v matchpathcon
>/dev
/null
2>&1
23 mkdir
-p /var
/log
/audit
-Z `matchpathcon -n /var/log/audit`
25 mkdir
-p /var
/log
/audit
28 # Run audit daemon executable
29 start-stop-daemon
-S -q -p ${PIDFILE} --exec ${DAEMON}
32 # Load the default rules
33 test -f /etc
/audit
/rules.d
/audit.rules
&& /usr
/sbin
/auditctl
-R /etc
/audit
/rules.d
/audit.rules
>/dev
/null
41 printf "Stopping ${NAME}: "
43 start-stop-daemon
-K -q -p ${PIDFILE}
44 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
48 printf "Reloading ${NAME} configuration: "
49 start-stop-daemon
--stop -s 1 -p ${PIDFILE} 1>/dev
/null
50 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
54 printf "Rotating ${NAME} logs: "
55 start-stop-daemon
--stop -s 10 -p ${PIDFILE} 1>/dev
/null
56 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
77 echo "Usage: $0 {start|stop|restart|reload|rotate}"