File: inn.init

package info (click to toggle)
inn 1%3A1.7.2debian-29
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,136 kB
  • ctags: 48
  • sloc: perl: 4,875; sh: 492; makefile: 219; ansic: 55
file content (53 lines) | stat: -rw-r--r-- 1,500 bytes parent folder | download
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
#!/bin/sh -e
#
# Start/stop the news server.

test -f /usr/sbin/innd || exit 0

case "$1" in
  start)
    start-stop-daemon --quiet --start --exec /etc/news/boot
    ;;
  stop)
    echo -n "Stopping news server:"
    if [ -f /var/run/innd/innwatch.pid ]; then
      echo -n " innwatch"
      start-stop-daemon --quiet --stop --oknodo \
        --pidfile /var/run/innd/innwatch.pid
    fi
    if [ -f /var/run/innd/actived.pid ]; then
      echo -n " actived"
      start-stop-daemon --quiet --stop --oknodo
        --pidfile /var/run/innd/actived.pid --exec /usr/lib/news/bin/actived
    fi
    rm -f /var/run/innd/actived.pid /var/run/innd/innwatch.pid
    if [ -f /var/run/innd/innd.pid ]; then
      echo -n " innd"
      ctlinnd -s -t 20 throttle 'system is going down' || true
      ctlinnd -s -t 20 shutdown 'system is going down' || true
      start-stop-daemon --quiet --stop --oknodo \
        --pidfile /var/run/innd/innd.pid --exec /usr/sbin/innd
    fi
    echo "."
    ;;
  reload|force-reload)
    echo -n "Reloading INN configuration files: "
    ctlinnd -t 20 reload '' /etc/init.d/inn
    ;;
  restart)
    echo -n "Restarting innd: "
    if [ -f /var/run/innd/innd.pid ]; then
      ctlinnd -t 20 xexec inndstart ||
        start-stop-daemon --quiet --start --exec /etc/news/boot
    else
      start-stop-daemon --quiet --start --exec /etc/news/boot
    fi
    echo "done."
    ;;
  *)
    echo "Usage: /etc/init.d/inn start|stop|restart|reload" >&2
    exit 1
    ;;
esac

exit 0