source: mpich2/1.0.7/debian/mpich2-mpd.mpd.init @ 134

Last change on this file since 134 was 44, checked in by jazz, 16 years ago
  • Debian Package folder which had tested on debian Etch and Ubuntu Hardy.
  • note: Lenny does not have package libg2c0
File size: 1.9 KB
Line 
1#! /bin/sh
2#
3# mpd   mpd global ring init script
4#
5#   Written by Zach Lowry <zach@zachlowry.net>.
6#
7# Based on skeleton by Miquel van Smoorenburg and Ian Murdock
8
9PATH=/sbin:/bin:/usr/sbin:/usr/bin
10DAEMON=/usr/bin/mpd
11CONF=/etc/mpd.conf
12NAME=mpd
13DESC=mpd
14
15START="no"
16DEFAULTFILE=/etc/default/mpd
17
18if [ -f $DEFAULTFILE ]; then
19    . $DEFAULTFILE
20fi
21
22# MPDOPTIONS="--daemon $MPDOPTIONS"
23
24if [ "$START" != "yes" ]; then
25    echo "$DESC: disabled, see /etc/default/mpd"
26    exit 0;
27fi
28
29test -f $DAEMON || exit 0
30
31if [ ! -f $CONF ]; then
32  echo "$DESC: $CONF not found, see 'man 3 mpd'"
33  exit 0;
34fi
35
36set -e
37
38case "$1" in
39  start)
40  echo -n "Starting $DESC: "
41  start-stop-daemon --start --make-pidfile --background --quiet --pidfile /var/run/$NAME.pid \
42    --exec $DAEMON -- $MPDOPTIONS
43  echo "$NAME."
44  ;;
45  stop)
46  echo -n "Stopping $DESC: "
47  start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid
48  echo "$NAME."
49  ;;
50  #reload)
51    #
52    #       If the daemon can reload its config files on the fly
53    #       for example by sending it SIGHUP, do it here.
54    #
55    #       If the daemon responds to changes in its config file
56    #       directly anyway, make this a do-nothing entry.
57    #
58    # echo "Reloading $DESC configuration files."
59    # start-stop-daemon --stop --signal 1 --quiet --pidfile \
60    #       /var/run/$NAME.pid --exec $DAEMON
61  #;;
62  restart|force-reload)
63    #
64    #       If the "reload" option is implemented, move the "force-reload"
65    #       option to the "reload" entry above. If not, "force-reload" is
66    #       just the same as "restart".
67    #
68    echo -n "Restarting $DESC: "
69    start-stop-daemon --oknodo --stop --quiet --pidfile \
70        /var/run/$NAME.pid
71    sleep 1
72    start-stop-daemon --start --make-pidfile --background --quiet --pidfile \
73        /var/run/$NAME.pid --exec $DAEMON -- $MPDOPTIONS
74    echo "$NAME."
75    ;;
76  *)
77  N=/etc/init.d/$NAME
78  echo "Usage: $N {start|stop}" >&2
79  exit 1
80  ;;
81esac
82
83exit 0
Note: See TracBrowser for help on using the repository browser.