File: init

package info (click to toggle)
restartd 0.2.3-1.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 152 kB
  • sloc: ansic: 582; sh: 44; makefile: 20
file content (66 lines) | stat: -rw-r--r-- 1,504 bytes parent folder | download | duplicates (2)
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
#! /bin/sh
# /etc/init.d/restartd
#
# Written by Tibor Koleszar <oldw@debian.org>.
# Modified by Aurélien GÉRÔME <ag@roxor.cx>.

### BEGIN INIT INFO
# Provides:          restartd
# Required-Start:    $syslog $remote_fs
# Required-Stop:     $syslog $remote_fs
# Should-Start:      $local_fs
# Should-Stop:       $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Restartd daemon init.d script
# Description:       Use to manage the Restartd daemon.
### END INIT INFO

set -e

DAEMON=/usr/sbin/restartd
PARAMS=""
PID="/var/run/restartd.pid"

test -x $DAEMON || exit 0

case "$1" in
  start)
    echo -n "Starting process checker: "
    $DAEMON $PARAMS
    echo "restartd."
    ;;
  stop)
    echo -n "Stopping process checker: "
    if kill `cat /var/run/restartd.pid 2>/dev/null` >/dev/null 2>&1
    then
    rm -f /var/run/restartd.pid
    else
    echo -n "not running: "
    fi
    echo "restartd."
      ;;
  restart)
    echo -n "Stopping process checker: "
    if kill `cat /var/run/restartd.pid 2>/dev/null` >/dev/null 2>&1
    then
    rm -f /var/run/restartd.pid
    else
    echo -n "not running: "
    fi
    echo "restartd."
    echo -n "Starting process checker: "
    $DAEMON $PARAMS
    echo "restartd."
      ;;
  reload|force-reload)
    echo "Reloading restartd configuration files"
    kill -HUP `cat /var/run/restartd.pid`
    ;;
  *)
    echo "Usage: /etc/init.d/restartd {start|stop|restart|reload|force-reload}"
    exit 1
    ;;
esac

exit 0