File: rc.d-script

package info (click to toggle)
albatross 1.36-5.5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,472 kB
  • ctags: 1,822
  • sloc: python: 7,437; makefile: 149; sh: 132
file content (40 lines) | stat: -rw-r--r-- 868 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
#
# SysV-style init.d script for the albatross session daemon
#
# $Id: rc.d-script 5897 2002-06-12 04:30:52Z andrewm $
#

DAEMON=/usr/local/bin/al-session-daemon
USER=albatross
LOGFILE=/var/log/al-session-daemon.log
PIDFILE=/var/run/albatross/session-daemon.pid

test -x ${DAEMON} || exit 0

umask 077

case "$1" in
    start)
        echo "Starting albatross session daemon"
        piddir=`dirname ${PIDFILE}`
        touch ${LOGFILE} 
        if [ ! -d ${piddir} ]; then
            mkdir ${piddir}
        fi
        chown ${USER} ${LOGFILE} ${piddir}
        su ${USER} -c "${DAEMON} -l ${LOGFILE} -k ${PIDFILE} start"
        ;;

    stop)
        echo "Stopping albatross session daemon"
        su ${USER} -c "${DAEMON} -l ${LOGFILE} -k ${PIDFILE} stop"
        ;;

    *)
        echo "Usage: $* {start|stop}"
        exit 1
        ;;
esac

exit 0