add sysvinit startup scripts

This commit is contained in:
Alexandre Ratchov 2013-11-26 19:48:33 +01:00
parent 305695dee8
commit 4a795e1c34
4 changed files with 71 additions and 4 deletions

View File

@ -28,4 +28,5 @@ distclean: clean
rm -f \
Makefile libsndio/Makefile \
sndiod/Makefile sndioctl/Makefile \
aucat/Makefile examples/Makefile
aucat/Makefile examples/Makefile \
contrib/init.d.sndiod

7
configure vendored
View File

@ -159,8 +159,9 @@ if [ $rmidi = yes ]; then
defs="$defs -DUSE_RMIDI"
fi
for makefile in Makefile aucat/Makefile sndiod/Makefile \
libsndio/Makefile sndioctl/Makefile examples/Makefile
for f in Makefile aucat/Makefile sndiod/Makefile \
libsndio/Makefile sndioctl/Makefile examples/Makefile \
contrib/init.d.sndiod
do
sed \
-e "s:@bindir@:$bindir:" \
@ -174,7 +175,7 @@ do
-e "s:@vars@:${vars}:" \
-e "s:@precision@:$precision:" \
-e "s:@user@:$user:" \
< $makefile.in > $makefile
< $f.in > $f
done
cat <<EOF

2
contrib/default.sndiod Normal file
View File

@ -0,0 +1,2 @@
# Additional options that are passed to the Daemon.
DAEMON_OPTS=""

63
contrib/init.d.sndiod.in Normal file
View File

@ -0,0 +1,63 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: sndiod
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: sndio audio and MIDI server
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="sndio audio and MIDI server"
NAME="sndiod"
DAEMON=@bindir@/sndiod
DAEMON_ARGS=""
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --quiet --oknodo \
--exec $DAEMON -- $DAEMON_ARGS
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --quiet --oknodo \
--exec $DAEMON
log_end_msg $?
;;
status)
if start-stop-daemon --status --exec $DAEMON; then
log_success_msg "$NAME is running"
exit 0
else
log_failure_msg "$NAME is not running"
exit 1
fi
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_ARGS
start-stop-daemon --stop --quiet --exec $DAEMON
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
: