Add patrekur's bsd init script, move all init scripts to contrib/init.d

This commit is contained in:
Ron Pedde
2006-04-17 05:04:21 +00:00
parent e3fc9fa94c
commit d6ac7d5744
7 changed files with 28 additions and 150 deletions

56
contrib/init.d/mt-daapd-fedora Executable file
View File

@@ -0,0 +1,56 @@
#!/bin/sh
#
# chkconfig: 2345 85 15
# description: mt-daapd is a multi-threaded DAAP server for iTunes
# processname: mt-daapd
# pidfile: /var/run/mt-daapd
#
# source function library
. /etc/init.d/functions
[ -e /etc/daapd.conf ]
RETVAL=0
start() {
echo -n $"Starting DAAP server: "
daemon mt-daapd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/mt-daapd
}
stop() {
echo -n $"Shutting down DAAP server: "
# This is broken.
killall -INT mt-daapd
# killproc mt-daapd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mt-daapd
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
status)
status mt-daapd
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL

38
contrib/init.d/mt-daapd-gentoo Executable file
View File

@@ -0,0 +1,38 @@
#!/sbin/runscript
#
# description: mt-daapd is a multi-threaded DAAP server for iTunes
# processname: mt-daapd
# Init script to start/stop mt-daapd for Gentoo Linux 2004.2
#
# This file needs to be in your /etc/init.d directory.
# To start mt-daapd, type "/etc/init.d/mt-daapd start"
# To stop it, type "/etc/init.d/mt-daapd stop"
# To start it automagically, type "rc-update add mt-daapd default"
#
#
# rob@robnunn.com (31st July 2004)
depend() {
# not much point having the daemon without a network
need net
# and if this goes according to plan, we provide daap
provide daap
}
# start the mt-daapd daemon. All fairly self-explanatory.
# lock files aren't necessary (as far as i can tell) since gentoo
# won't let us run multiple copies.
start() {
ebegin "Starting mt-daapd DAAP server"
start-stop-daemon --start --quiet --exec /usr/local/sbin/mt-daapd
eend $?
}
# stop the daemon
stop() {
ebegin "Stopping mt-daapd DAAP server"
# start-stop-daemon --stop --quiet --exec /usr/local/sbin/mt-daapd
# I dunno if this works... try it:
start-stop-daemon --stop --quiet --pidfile /var/run/mt-daapd.pid --signal 2
eend $?
}

21
contrib/init.d/mtdaapd-bsd Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
#
# PROVIDE: mtdaapd mt-daapd
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# mt-daapd daemon.
#
# Created by Patrick Lemmens for NetBSD and FreeBSD.
. /etc/rc.subr
name="mtdaapd"
realname="mt-daapd"
rcvar=$name
command="/usr/local/bin/${realname}"
pidfile="/var/run/${realname}.pid"
sig_stop="SIGINT"
load_rc_config $name
run_rc_command "$1"