Bugfix: parsing of plugins.d failed with some file-systems
[profile/ivi/automotive-message-broker.git] / ambd / ambd.in
1 #!/bin/sh
2 ### BEGIN INIT INFO
3 # Provides:          ambd
4 # Required-Start:    $remote_fs
5 # Required-Stop:     $remote_fs
6 # Default-Start:     2 3 4 5
7 # Default-Stop:      0 1 6
8 # Short-Description: Automotive Message Broker daemon
9 ### END INIT INFO
10
11 # Source function library.
12 . /etc/init.d/functions
13
14 PATH=/bin:/usr/bin:/sbin:/usr/sbin
15
16 [ -f /etc/default/rcS ] && . /etc/default/rcS
17 [ -f /etc/default/ambd ] && . /etc/default/ambd
18
19 case "$1" in
20     start)
21         echo -n "Starting Automotive Message Broker daemon: "
22         start-stop-daemon -S -x @CMAKE_INSTALL_PREFIX@/bin/ambd -- -D
23         if [ $? = 0 ]; then
24             echo "ambd."
25         else
26             echo "(failed.)"
27         fi
28         ;;
29     stop)
30         echo -n "Stopping Automotive Message Broker daemon: "
31         start-stop-daemon -K -x @CMAKE_INSTALL_PREFIX@/bin/ambd
32         echo "apmd."
33         ;;
34     status)
35         status @CMAKE_INSTALL_PREFIX@/bin/ambd;
36         exit $?
37         ;;
38     restart|force-reload) 
39         $0 stop
40         $0 start
41         exit
42         ;;
43     *)
44         echo "Usage: /etc/init.d/ambd {start|stop|status|restart|force-reload}"
45         exit 1
46         ;;
47 esac
48
49 exit 0
50