aboutsummaryrefslogtreecommitdiff
path: root/security/sguil-server/files/sguild.in
blob: 10860b42701795e31ef3a8e8f68a600bbe900af8 (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
#!/bin/sh

# $FreeBSD$

# PROVIDE: sguild
# REQUIRE: DAEMON
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable sguild:
# sguild_enable (bool):		Set to YES to enable sguild
# 				Default: NO
# The following commandline arguments are available for sguild
# "  -c <filename>: PATH to the sguild config (sguild.conf) file."
# "  -a <filename>: PATH to the autocat config (autocat.conf) file."
# "  -g <filename>: PATH to the sguild global queries (sguild.queries) file."
# "  -u <filename>: PATH to the sguild users (sguild.users) file."
# "  -P <filename>: Name of file to write the PID to."
# "                 Default is /var/run/%%SGUILDIR%%/sguild.pid"
# "  -l <filepath>: PATH to sguild libraries."
# "  -O <filename>: Define PATH to tls (tcl openssl) lib (libtls1.x.so)"
# "  -C <directory>: Directory that contains sguild.pem and sguild.key"
# "  -D Runs sguild in daemon mode."
# "  -A <filename>: PATH to sguild.access file."
# "  -d <0|1|2>: Set DEBUG level"
# sguild_flags (str):		Extra flags passed to sguild
#				Default: -D -P ${pid}
# sguild_conf (str):		Sguild configuration file
#				Default: %%PREFIX%%/etc/%%SGUILDIR%%/sguild.conf
# sguild_user (str):		Default: sguild
# Note: this value MUST be set in /etc/rc.conf if you do not accept the default
# user created by the pkg-install script

. /etc/rc.subr

load_rc_config sguild
# set some defaults
sguild_enable=${sguild_enable:-"NO"}
sguild_conf=${sguild_conf:-"/%%PREFIX%%/etc/%%SGUILDIR%%/sguild.conf"}
pid=${pid:-"/var/run/%%SGUILDIR%%/sguild.pid"}
sguild_flags=${sguild_flags:-"-D -P ${pid}"}
sguild_user=${sguild_user:-"sguil"}

name="sguild"
rcvar=sguild_enable
command="%%PREFIX%%/bin/${name}"
command_args="-c ${sguild_conf} ${sguild_flags}"
procname="%%TCLSH%%"
check_process="${procname}"
sguild_user="sguil"

run_rc_command "$1"