aboutsummaryrefslogtreecommitdiffstats
path: root/net-im/jabberd/files/jabberd.in
blob: 6ebd436dd806b140dd5bf479ac7687a55b300df7 (plain) (blame)
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
#!/bin/sh

# $FreeBSD$

# PROVIDE: jabberd
# REQUIRE: %%REQUIRE%%
# KEYWORD: shutdown


# Define these jabberd_* variables in one of these files:
#       /etc/rc.conf
#       /etc/rc.conf.local
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
jabberd_chdir=${jabberd_chdir-"%%JABBER_RUNDIR%%/pid"}
jabberd_enable=${jabberd_enable-"NO"}
jabberd_user=${jabberd_user-"%%JABBER_USER%%"}

. %%RC_SUBR%%

name="jabberd"
rcvar=`set_rcvar`
command_interpreter="%%PERL%%"
command="%%PREFIX%%/bin/jabberd"
command_args="-b"
stop_postcmd=jabberd_post_stopcmd

load_rc_config $name

jabberd_post_stopcmd()
{
    for file in c2s router s2s sm; do
        rm -f ${jabberd_chdir}/$file.pid
    done
}

case "$1" in
    forcestop)
        echo "Stopping jabberd."
        killall -u ${jabberd_user} c2s router s2s sm
        jabberd_post_stopcmd
    ;;
    *)
        run_rc_command "$1"
    ;;
esac