File: //etc/init.d/paxctld
#!/bin/sh
#
# paxctld PaX flags maintenance daemon
#
# chkconfig: 2345 01 99
# description PaX flags maintenance daemon
#
# processname: paxctld
# config: /etc/paxctld.conf
# pidfile: /var/run/paxctld.pid
### BEGIN INIT INFO
# Provides: paxctld
# Required-Start: $local_fs $network $remote_fs $syslog
# Required-Stop: $local_fs $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
# Author: Open Source Security, Inc. <support@grsecurity.net>
# Do NOT "set -e"
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="PaX flags maintenance daemon"
NAME=paxctld
DAEMON=/sbin/paxctld
PIDFILE=/var/run/$NAME.pid
DAEMON_ARGS="-d -p $PIDFILE"
SCRIPTNAME=/etc/rc.d/init.d/$NAME
CONFIG=/etc/paxctld.conf
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# source function library
. /etc/rc.d/init.d/functions
lockfile=/var/lock/subsys/$NAME
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $NAME: "
daemon $DAEMON $DAEMON_ARGS
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $NAME: "
killproc $NAME
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
status $NAME
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?