summaryrefslogtreecommitdiff
path: root/rc.kolabd.in
blob: 1e0b8faa031f37cfaf8844f01d465c3e9faa6883 (plain)
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
67
68
69
70
#!@BASH@ @sysconfdir@/rc
##
##  rc.kolabd -- Run-Commands
##

%config
    kolabd_enable="$openpkg_rc_def"
    kolabd_log_fbview_logfile="@fbview_logfile@"
    kolabd_log_fbview_owner="@kolab_usr@"
    kolabd_log_fbview_group="@kolab_grp@"
    kolabd_log_fbview_prolog="true"
    kolabd_log_fbview_epilog="true"
    kolabd_log_fbview_numfiles="10"
    kolabd_log_fbview_minsize="1M"
    kolabd_log_fbview_complevel="9"

%common
    kolabd_pidfile="@kolab_pidfile@"
    kolabd_signal () {
        [ -f $kolabd_pidfile ] && kill -$1 `cat $kolabd_pidfile`
    }

%status -u @kolab_susr@ -o
    kolabd_usable="unknown"
    kolabd_active="no"
    rcService kolabd enable yes && \
        kolabd_signal 0 && kolabd_active="yes"
    echo "kolabd_enable=\"$kolabd_enable\""
    echo "kolabd_usable=\"$kolabd_usable\""
    echo "kolabd_active=\"$kolabd_active\""

%start -p 600 -u @kolab_susr@
    rcService kolabd enable yes || exit 0
    rcService kolabd active yes && exit 0
    @sbindir@/kolabd &
    sleep 5

%stop -p 600 -u @kolab_susr@
    rcService kolabd enable yes || exit 0
    rcService kolabd active no  && exit 0
    kolabd_signal TERM
    sleep 5

%restart -u @kolab_susr@
    rcService kolabd enable yes || exit 0
    rcService kolabd active no  && exit 0
    rc kolabd stop start

%reload -u @kolab_susr@
    rcService kolabd enable yes || exit 0
    rcService kolabd active no  && exit 0
    kolabd_signal HUP
    sleep 5

%daily -u @kolab_susr@
    rcService kolabd enable yes || exit 0
    #   rotate logfiles
    shtool rotate -f \
        -n ${kolabd_log_fbview_numfiles} -s ${kolabd_log_fbview_minsize} -d \
        -z ${kolabd_log_fbview_complevel} -m 640 \
        -o ${kolabd_log_fbview_owner} \
        -g ${kolabd_log_fbview_group} \
        -P "${kolabd_log_fbview_prolog}" \
        -E "${kolabd_log_fbview_epilog}" \
        "${kolabd_log_fbview_logfile}"

%quarterly -u @kolab_musr@
    rcService kolabd enable yes || exit 0
    rcService kolabd active no  && exit 0
    @bindir@/kolabquotawarn