/etc/init.d/alljoyn-daemon-1509 is in alljoyn-daemon-1509 15.09a-5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | #!/bin/sh
### BEGIN INIT INFO
# Provides: alljoyn-daemon-1509
# Required-Start: $local_fs $network $named $time $syslog $remote_fs
# Required-Stop: $local_fs $network $named $time $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Provides the standalone AllJoyn bus.
# Short-Description: Provides the standalone AllJoyn bus.
### END INIT INFO
RUNAS=root
NAME=alljoyn-daemon
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
LOGFILE=/var/log/$NAME.log
. /lib/lsb/init-functions
start() {
if [ -f $PIDFILE ] && kill -0 $(cat $PIDFILE); then
echo 'Service already running' >&2
return 1
fi
echo 'Starting serviceā¦' >&2
start-stop-daemon --start --exec $DAEMON -- "--config-file=/etc/alljoyn-daemon/config.xml &> \"$LOGFILE\" "
# local CMD="$SCRIPT --config-file=/etc/alljoyn-daemon/config.xml &> \"$LOGFILE\" & echo \$!"
# su -c "$CMD" $RUNAS > "$PIDFILE"
echo 'Service started' >&2
}
stop() {
if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then
echo 'Service not running' >&2
return 1
fi
echo 'Stopping serviceā¦' >&2
start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON --oknodo --quiet
echo 'Service stopped' >&2
# kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
}
status() {
status_of_proc $DAEMON $NAME
# printf "%-50s" "Checking $NAME..."
# if [ -f $PIDFILE ]; then
# PID=$(cat $PIDFILE)
# if [ -z "$(ps axf | grep ${PID} | grep -v grep)" ]; then
# printf "%s\n" "The process appears to be dead but pidfile still exists"
# else
# echo "Running, the PID is $PID"
# fi
# else
# printf "%s\n" "Service not running"
# fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart|force-reload)
stop
start
;;
*)
echo "Usage: $0 {start|stop|status|restart|force-reload}"
esac
|