opt/rpcbind/rpcbind

39 lines
688 B
Plaintext
Raw Normal View History

2010-06-15 20:03:29 +02:00
#!/bin/sh
#
# /etc/rc.d/rpcbind: start/stop rpcbind daemon
#
2015-02-20 11:21:55 +01:00
SSD=/sbin/start-stop-daemon
PROG=/sbin/rpcbind
2022-02-15 18:25:57 +01:00
PID=/run/rpcbind/rpcbind.pid
2016-12-03 16:40:18 +01:00
OPTS="-f -s"
2015-02-20 11:21:55 +01:00
2010-06-15 20:03:29 +02:00
case $1 in
start)
2022-02-15 18:25:57 +01:00
mkdir -p /run/rpcbind
2015-02-20 11:21:55 +01:00
$SSD --start -bm --pidfile $PID --exec $PROG -- $OPTS
2010-06-15 20:03:29 +02:00
;;
stop)
2015-02-20 11:21:55 +01:00
$SSD --stop --remove-pidfile --retry 10 --pidfile $PID
2010-06-15 20:03:29 +02:00
;;
restart)
$0 stop
$0 start
;;
2015-02-20 11:21:55 +01:00
status)
$SSD --status --pidfile $PID
case $? in
2015-04-28 12:22:36 +02:00
0) echo "$PROG is running with pid $(cat $PID)" ;;
2015-02-20 11:21:55 +01:00
1) echo "$PROG is not running but the pid file $PID exists" ;;
3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
2010-06-15 20:03:29 +02:00
*)
2015-02-20 11:21:55 +01:00
echo "usage: $0 [start|stop|restart|status]"
2010-06-15 20:03:29 +02:00
;;
esac
# End of file
2015-02-20 11:21:55 +01:00