blob: 1e45d5d05f8c0abb1a54e756e82b218e678d1dfa (
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
48
49
50
51
52
53
54
55
56
|
#!/bin/sh
# PROVIDE: %%PORTNAME%%
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# vuls_enable (bool): Set to NO by default
# Set it to YES to enable the vuls server
# vuls_user (string): Set user to run vuls
# Default is "%%USERS%%"
# vuls_group (string): Set group to run vuls
# Default is "%%GROUPS%%"
# vuls_log_file (string): Set file that vuls will log to
# Default is "/var/log/vuls/vuls.log"
# vuls_args (string): Set additional command line arguments
# Default is ""
#
# Set up vuls using the config file: %%ETCDIR%%/config.toml
#
. /etc/rc.subr
name=vuls
rcvar=vuls_enable
load_rc_config $name
: ${vuls_enable:="NO"}
: ${vuls_user:="%%USERS%%"}
: ${vuls_group:="%%GROUPS%%"}
: ${vuls_log_file:="/var/log/vuls/vuls.log"}
: ${vuls_results_dir:="/var/db/vuls/results"}
: ${vuls_listen:="0.0.0.0:5515"}
: ${vuls_args:=""}
pidfile=/var/run/${name}.pid
pidfile_daemon=/var/run/${name}_daemon.pid
command="/usr/sbin/daemon"
procname="%%PREFIX%%/bin/%%PORTNAME%%"
command_args="-p ${pidfile} -P ${pidfile_daemon} -t ${name} -Ho ${vuls_log_file} \
${procname} server -results-dir=${vuls_results_dir} -to-localfile -listen=${vuls_listen} ${vuls_args}"
start_precmd=vuls_startprecmd
vuls_startprecmd()
{
/usr/bin/install -o ${vuls_user} -g ${vuls_group} -m 640 /dev/null ${pidfile}
/usr/bin/install -o ${vuls_user} -g ${vuls_group} -m 640 /dev/null ${pidfile_daemon}
}
load_rc_config $name
run_rc_command "$1"
|