File: lyskom-server.init.d

package info (click to toggle)
lyskom-server 2.1.2-16
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 10,572 kB
  • sloc: ansic: 51,006; exp: 12,368; sh: 10,501; python: 2,927; makefile: 1,025; yacc: 466; awk: 340; lisp: 271; lex: 218; sed: 50
file content (65 lines) | stat: -rw-r--r-- 1,581 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
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
#! /bin/sh
#
# /etc/init.d/lyskom-server: start and stop the LysKOM server
# See below for information on how to enable.
#
### BEGIN INIT INFO
# Provides:          lyskom-server
# Required-Start:    $syslog $network $time $local_fs $remote_fs
# Required-Stop:     $syslog $network $time $local_fs $remote_fs
# Should-Start:
# Should-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start and stop the LysKOM server
# Description:       Used to start and stop the LysKOM server.
#                    Automatic start is by default disabled, edit
#                    /etc/default/lyskom-server to enable automatic
#                    start through this script.
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="LysKOM server"
NAME=komrunning
RUNDIR=/var/run/lyskom-server

if [ -f  /etc/default/lyskom-server ]; then
  . /etc/default/lyskom-server
fi

test -x /usr/sbin/komrunning || exit 0

. /lib/lsb/init-functions

if [ ! -d ${RUNDIR} ]; then
  if ! install -o lyskom -m 755 -d ${RUNDIR}; then
    log_failure_msg "Failed to create ${RUNDIR}"
    exit 1
  fi
fi

case "$1" in
  start|force-start)
    log_begin_msg "Signalling start of ${DESC}"
    /usr/sbin/komrunning start
    /usr/sbin/updateLysKOM
    log_end_msg $?
    ;;

  stop)
    log_begin_msg "Stopping ${DESC}" ${NAME}
    /usr/sbin/komrunning stop && rm -f ${RUNDIR}/pid
    log_end_msg $?
    ;;

  restart|force-reload)
    sh $0 stop
    sh $0 force-start
    ;;

  *)
    echo "Usage: /etc/init.d/lyskom-server {start|force-start|stop|restart}"
    ;;
esac

exit 0