wok view dbus/stuff/etc/init.d/dbus @ rev 2503

libgsf: update WGET_URL
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Mar 16 12:04:46 2009 +0000 (2009-03-16)
parents 09d1e6a18156
children d4cf16d55526
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 active_pidfile $PIDFILE dbus-daemon ; 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 ! active_pidfile $PIDFILE dbus-daemon ; 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 ! active_pidfile $PIDFILE dbus-daemon ; 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