summaryrefslogtreecommitdiffstats
path: root/databases/cyrus-imspd/files/imspd.in
blob: f18ef0f29b3cb7731b125a2a3891d82e217e29bd (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
#! /bin/sh
#
#
# PROVIDE: imspd
# REQUIRE: DAEMON NETWORKING SERVERS
#
# Add the following line to /etc/rc.conf to enable imspd:
#
# imspd_enable="YES"
#
# Tweakable parameters for users to override in rc.conf

. /etc/rc.subr

name=imspd
rcvar=imspd_enable

load_rc_config ${name}
: ${imspd_enable="NO"}
: ${imspd_pidfile=/var/run/imspd.pid}
: ${imspd_options=/var/imspd/options}

pidfile=${imspd_pidfile}
start_postcmd="start_postcmd"
stop_postcmd="stop_postcmd"
required_files=${imspd_options}
command="%%PREFIX%%/sbin/imspd"
command_args=">/dev/null &"

start_postcmd()
{
        PID=`pgrep imspd`
        [ -n "${PID}" ] && echo ${PID} > ${pidfile}
}

stop_postcmd()
{
        [ -f "${pidfile}" ] && rm ${pidfile}
}

run_rc_command "$1"
OpenPOWER on IntegriCloud