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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#!/sbin/runscript
## Copyright 2006 Michael Rash
# Distributed under the terms of the GNU General Public License v2
# Author: Michael Rash
# Developed for the Gentoo Linux distribution
depend() {
need logger
}
checkconfig() {
if [ ! -f /etc/psad/psad.conf ] ; then
eerror "Please create /etc/psad/psad.conf"
eerror "You can find a sample config file at /etc/psad/psad.conf.sample"
return 1
fi
return 0
}
start() {
checkconfig || return 1
ebegin "Starting ${SVCNAME}"
start-stop-daemon \
--start \
--quiet \
--name psad \
--exec /usr/sbin/psad \
--pidfile /var/run/psad/psad.pid
eend $? "Failed to start ${SVCNAME}"
}
stop() {
ebegin "Stopping psadwatchd"
start-stop-daemon --stop --quiet --pidfile /var/run/psad/psadwatchd.pid
eend $? "Failed to stop psadwatchd"
if [ -f /var/run/psad/kmsgsd.pid ] ; then
ebegin "Stopping kmsgsd"
start-stop-daemon --stop --quiet --pidfile /var/run/psad/kmsgsd.pid
eend $? "Failed to stop kmsgsd"
fi
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --quiet --pidfile /var/run/psad/psad.pid
eend $? "Failed to stop ${SVCNAME}"
}
|