aboutsummaryrefslogtreecommitdiff
path: root/databases/foundationdb/files/foundationdb.in
blob: 84e0a036a8ae13cf61800580360b308a9fab1280 (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

# PROVIDE: foundationdb
# REQUIRE: LOGIN
# BEFORE:  securelevel
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable `foundationdb':
#
#foundationdb_enable="YES"
#
# Define config file here to run with different config file:
#
#foundationdb_config="xxxxx"
#

. /etc/rc.subr

name="foundationdb"
rcvar="${name}_enable"

load_rc_config "$name"

: ${foundationdb_enable="NO"}
: ${foundationdb_user="%%FOUNDATIONDB_USER%%"}
: ${foundationdb_group="%%FOUNDATIONDB_GROUP%%"}
: ${foundationdb_config="%%PREFIX%%/etc/foundationdb/foundationdb.conf"}

start_precmd="foundationdb_start_precmd"

pidfile="/var/run/fdbmonitor.pid"
command=%%PREFIX%%/bin/fdbmonitor
command_args="--conffile ${foundationdb_config} --lockfile ${pidfile} --daemonize"

foundationdb_start_precmd()
{
	if [ ! -e "${pidfile}" ]; then
		install -m 0600 -o "${foundationdb_user}" -g "${foundationdb_group}" /dev/null "${pidfile}"
	fi
}

run_rc_command $1