File: mailman.rtupdate

package info (click to toggle)
mailman 1%3A2.1.9-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 29,236 kB
  • ctags: 2,701
  • sloc: python: 22,177; sh: 1,275; makefile: 1,082; perl: 614; ansic: 356
file content (57 lines) | stat: -rw-r--r-- 1,426 bytes parent folder | download | duplicates (9)
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
#!/bin/sh

# this script stops mailman before a Python default runtime change and
# restarts it afterwards

DESC="Mailman MailingList Server"
NAME="mailman"
SCRIPTNAME="/etc/init.d/$NAME"

# Read configuration variable file if it is present
[ -r "/etc/default/$NAME" ] && . "/etc/default/$NAME"

# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

if [ "$#" != 3 ]; then
    echo "Usage: $0 {pre-rtupdate|post-rtupdate|rtupdate} <oldruntime> <newruntime>" >&2
    exit 1
fi

action="$1"
oldruntime="$2"
newruntime="$3"

case "$action" in
  pre-rtupdate)
    [ "$VERBOSE" != no ] && log_warning_msg "Stopping $DESC during Python runtime change..."
    if [ -x "$SCRIPTNAME" ]; then
        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
            invoke-rc.d "$NAME" stop
        else
            "$SCRIPTNAME" stop
        fi
    fi
  ;;
  post-rtupdate)
    [ "$VERBOSE" != no ] && log_warning_msg "Restarting $DESC after Python runtime change..."
    if [ -x "$SCRIPTNAME" ]; then
        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
            invoke-rc.d "$NAME" start
        else
            "$SCRIPTNAME" start
        fi
    fi
  ;;
  rtupdate)
  ;;
  *)
    echo "$0 called with unknown argument \`$action'" >&2
    exit 0
  ;;
esac