Sophie

Sophie

distrib > Mageia > 2 > x86_64 > media > core-release-src > by-pkgid > 2a41d467196fd336b7c793f6b6099da6 > files > 4

tomoyo-tools-2.5.0-2.mga2.src.rpm

#!/bin/sh

### BEGIN INIT INFO
# Provides: ccs-auditd
# Default-Start: 2 3 4 5
# Short-Description: TOMOYO Linux MAC logging daemon
# Description: ccs-auditd is a logging daemon for TomoyoLinux MAC related messages.
### END INIT INFO

# Source function library.
. /etc/init.d/functions

# Configuration variables
NAME="ccs-auditd"
OPTIONS="/dev/null /var/log/tomoyo/reject_log.conf"
LOCKFILE=/var/lock/subsys/tomoyo-auditd

umask 077

# Code
start() {
    rc=0
    if [ ! -f $LOCKFILE ]; then
	gprintf "Starting %s: " "$NAME"
	daemon tomoyo-auditd $OPTIONS
	rc=$?
	echo
	[ $rc -eq 0 ] && touch $LOCKFILE
    fi
    return $rc
}

stop() {
    gprintf "Shutting down %s: " "$NAME"
    killproc tomoyo-auditd
    rc=$?
    echo
    [ $rc -eq 0 ] && rm -f $LOCKFILE
    return $rc
}

restart() {
    stop
    start
}	


case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    restart)
	restart
	;;
    status)
	status tomoyo-auditd
	;;
    *)
	gprintf "Usage: %s {start|stop|restart|status}\n" "$0"
	exit 1
	;;
esac

exit $?