1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#!/bin/sh
# Helper script to provide legacy auditd service options not
# directly supported by systemd
# Check that we are root ... so non-root users stop here
test $(id -u) = 0 || exit 4
PATH=/sbin:/bin:/usr/bin:/usr/sbin
prog="auditd"
. /usr/libexec/audit-functions
pid=
p=$(pidof "$prog")
if [ -n "$p" ] ; then
pid="$p"
fi
printf "Stopping logging: "
killproc $prog -TERM
RETVAL=$?
if [ -n "$pid" ] ; then
# Wait up to 20 seconds for auditd to shutdown
timeout 20 tail --pid="$pid" -f /dev/null
fi
echo
exit $RETVAL
|