slackbuilds_ponce/network/xinetd/rc.xinetd
Chris Abela dfb782844d network/xinetd: Updated for version 2.3.15.
Also create /var/lock/subsys/ in rc.xinetd instead of putting
it inside the package; this handles the case where a sysadmin
puts /var/lock as tmpfs (e.g. /var/lock -> /run/lock)

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
2012-12-11 16:20:48 -05:00

105 lines
1.8 KiB
Bash

#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
RETVAL=0
start(){
echo "Starting xinetd: /usr/sbin/xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid "
# Need to get rid of localization for external services -
# it doesn't make much sense to have i18n on the server side here
LANG=en_US
LC_TIME=en_US
LC_ALL=en_US
LC_MESSAGES=en_US
LC_NUMERIC=en_US
LC_MONETARY=en_US
LC_COLLATE=en_US
export LANG LC_TIME LC_ALL LC_MESSAGES LC_NUMERIC LC_MONETARY LC_COLLATE
unset HOME MAIL USER USERNAME
# Make sure /var/lock/subsys exists
mkdir -p /var/lock/subsys
/usr/sbin/xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid
RETVAL=$?
[ "$RETVAL" = 0 ] && touch /var/lock/subsys/xinetd
return $RETVAL
}
stop(){
echo "Stopping xinetd... "
killall xinetd 2>/dev/null
RETVAL=$?
rm -f /var/lock/subsys/xinetd
return $RETVAL
}
restart(){
stop
sleep 1
start
}
reload(){
echo "Reloading xinetd configuration..."
killall -HUP xinetd 2>/dev/null
return $?
}
dump(){
echo -n $"Dumping configuration: "
killall -USR1 xinetd
RETVAL=$?
echo
return $RETVAL
}
check(){
echo $"Performing Consistency Check: "
/bin/kill -s IOT xinetd
RETVAL=$?
return $RETVAL
}
status(){
echo -n $"Checking xinetd: "
/bin/kill -s IOT xinetd 2>/dev/null
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo "xinetd is running"
else
echo "xinetd is not running"
fi
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
dump)
dump
;;
check)
check
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|dump|check|status}"
RETVAL=1
esac
exit $RETVAL