1#!/sbin/runscript 2# 3# description: mt-daapd is a multi-threaded DAAP server for iTunes 4# processname: mt-daapd 5# Init script to start/stop mt-daapd for Gentoo Linux 2004.2 6# 7# This file needs to be in your /etc/init.d directory. 8# To start mt-daapd, type "/etc/init.d/mt-daapd start" 9# To stop it, type "/etc/init.d/mt-daapd stop" 10# To start it automagically, type "rc-update add mt-daapd default" 11# 12# 13# rob@robnunn.com (31st July 2004) 14 15depend() { 16 # not much point having the daemon without a network 17 need net 18 # and if this goes according to plan, we provide daap 19 provide daap 20} 21 22# start the mt-daapd daemon. All fairly self-explanatory. 23# lock files aren't necessary (as far as i can tell) since gentoo 24# won't let us run multiple copies. 25start() { 26 ebegin "Starting mt-daapd DAAP server" 27 start-stop-daemon --start --quiet --exec /usr/local/sbin/mt-daapd 28 eend $? 29} 30 31# stop the daemon 32stop() { 33 ebegin "Stopping mt-daapd DAAP server" 34# start-stop-daemon --stop --quiet --exec /usr/local/sbin/mt-daapd 35# I dunno if this works... try it: 36 start-stop-daemon --stop --quiet --pidfile /var/run/mt-daapd.pid --signal 2 37 eend $? 38} 39