wok-6.x view dbus/stuff/etc/init.d/dbus @ rev 2085
Up + fix udev (137) put all rules in /etc/udev according to udev.conf
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Jan 27 14:28:03 2009 +0100 (2009-01-27) |
parents | b5d96006ea44 |
children | 6f02ebda33d4 |
line source
1 #!/bin/sh
2 # /etc/init.d/dbus: Start, stop and restart DBUS daemon on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
7 . /etc/daemons.conf
9 NAME=DBUS
10 DESC="message bus daemon"
11 DAEMON=/usr/bin/dbus-daemon
12 OPTIONS=$DBUS_OPTIONS
13 PIDFILE=/var/run/dbus/pid
14 MACHINE_ID=/var/lib/dbus/machine-id
16 if [ ! -f $MACHINE_ID ] ; then
17 dbus-uuidgen > $MACHINE_ID
18 fi
20 case "$1" in
21 start)
22 if [ -f $PIDFILE ] ; then
23 echo "$NAME already running."
24 exit 1
25 fi
26 echo -n "Starting $DESC: $NAME... "
27 $DAEMON $OPTIONS
28 status
29 ;;
30 stop)
31 if [ ! -f $PIDFILE ] ; then
32 echo "$NAME is not running."
33 exit 1
34 fi
35 echo -n "Stopping $DESC: $NAME... "
36 kill `cat $PIDFILE`
37 rm $PIDFILE
38 status
39 ;;
40 restart)
41 if [ ! -f $PIDFILE ] ; then
42 echo "$NAME is not running."
43 exit 1
44 fi
45 echo -n "Restarting $DESC: $NAME... "
46 kill `cat $PIDFILE`
47 rm $PIDFILE
48 sleep 2
49 $DAEMON $OPTIONS
50 status
51 ;;
52 *)
53 echo ""
54 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
55 echo ""
56 exit 1
57 ;;
58 esac
60 exit 0