blob: e2cf08e5a730c91bf34deb49009784c075e6a6ff (
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
|
#!/bin/sh
# PROVIDE: hostd
# REQUIRE: LOGIN FILESYSTEMS netwait
# KEYWORD: SHUTDOWN
#
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# hostd_enable (bool): Set to NO by default.
# Set it to YES to enable doormand.
# hostd_config (path): Set to %%PREFIX%%/etc/hostd.yml
# by default.
. /etc/rc.subr
name=hostd
rcvar=${name}_enable
load_rc_config $name
: ${hostd_enable:=NO}
: ${hostd_executable:="%%PREFIX%%/bin/hostd"}
: ${hostd_config:="%%PREFIX%%/etc/hostd.yml"}
hostd_env="HOSTD_CONFIG_FILE=${hostd_config}"
pidfile="/var/run/${name}.pid"
command="/usr/sbin/daemon"
command_args="-r -f -H \
-o \"/var/log/${name}.log\" \
-P \"${pidfile}\" \
-u %%USERS%% \"${hostd_executable}\""
run_rc_command "$1"
|