mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-01 01:00:03 +01:00
b213fa89de
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
103 lines
1.7 KiB
Bash
103 lines
1.7 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
|
|
/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
|
|
|
|
|