blob: 4a6f55c4be1093f9a737bf059b8c7483b0a2935b (
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
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: monit
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable monit:
# monit_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable monit
# monit_flags (str): Flags passed to monit on startup.
# Default is "".
#
. /etc/rc.subr
name="monit"
rcvar=`set_rcvar`
restart_precmd="monit_checkconfig"
reload_precmd="monit_checkconfig"
[ -z "$monit_enable" ] && monit_enable="NO"
load_rc_config $name
default_config=%%PREFIX%%/etc/monitrc
required_files=${default_config}
command="%%PREFIX%%/bin/monit"
command_args="-c ${default_config}"
pidfile="/var/run/monit.pid"
monit_checkconfig()
{
echo "Performing sanity check on monit configuration:"
${command} ${command_args} -t
}
extra_commands="reload"
run_rc_command "$1"
|