]> git.pld-linux.org Git - packages/audit.git/blame - auditd.init
- build PIE after Ac
[packages/audit.git] / auditd.init
CommitLineData
11fba1fa
JB
1#!/bin/sh
2#
3# auditd This starts and stops auditd
4#
5# chkconfig: 2345 18 87
6# description: This starts the Linux Auditing System Daemon
7#
8# processname: /sbin/auditd
9# config: /etc/sysconfig/auditd
10# config: /etc/auditd.conf
11# pidfile: /var/run/auditd.pid
12
13PATH=/sbin:/bin:/usr/bin:/usr/sbin
14
15# Source function library
16. /etc/rc.d/init.d/functions
17
18AUDITD_CLEAN_STOP=yes
19EXTRAOPTIONS=
20
21# Get service config - may override defaults
22[ -f /etc/sysconfig/auditd ] && . /etc/sysconfig/auditd
23
24RETVAL=0
25
26# See how we were called.
27case "$1" in
28 start)
29 if [ ! -f /var/lock/subsys/auditd ]; then
30 # show "Starting %s service" auditd
31 msg_starting auditd
32 unset HOME MAIL USER USERNAME
33 daemon auditd "$EXTRAOPTIONS"
34 RETVAL=$?
35 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/auditd
36 # Load the default rules
37 [ -f /etc/audit.rules ] && /sbin/auditctl -R /etc/audit.rules >/dev/null
38 else
39 # show "%s service is already running." auditd
40 msg_already_running auditd
41 fi
42 ;;
43 stop)
44 if [ -f /var/lock/subsys/auditd ]; then
45 # Stop daemons.
46 # show "Stopping %s service" auditd
47 msg_stopping auditd
48 killproc auditd
49 rm -f /var/lock/subsys/auditd
50 # Remove watches so shutdown works cleanly
51 if ! is_no "$AUDITD_CLEAN_STOP"; then
52 /sbin/auditctl -D >/dev/null
53 fi
54 else
55 # show "%s service is not running." auditd
56 msg_not_running auditd
57 fi
58 ;;
59 restart)
60 $0 stop
61 $0 start
62 exit $?
63 ;;
64 reload|force-reload)
65 if [ -f /var/lock/subsys/auditd ]; then
66 # show "Reload %s service" auditd
67 msg_reloading auditd
68 killproc auditd -HUP
69 RETVAL=$?
70 else
71 # show "%s service is not running." auditd
72 msg_not_running auditd >&2
73 RETVAL=7
74 fi
75 ;;
76 status)
77 status auditd
78 RETVAL=$?
79 ;;
80 *)
81 # show "Usage: %s {start|stop|restart|reload|force-reload|status}"
82 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
83 RETVAL=3
84esac
85
86exit $RETVAL
This page took 0.079301 seconds and 4 git commands to generate.