blob: 448b4381327bf7793f7c708bd129c35fae0db9e9 (
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
# PROVIDE: selenium
# REQUIRE: LOGIN
# KEYWORD: shutdown
. /etc/rc.subr
name="selenium"
rcvar=selenium_enable
load_rc_config "${name}"
: ${selenium_enable="NO"}
: ${selenium_args="standalone"}
: ${selenium_java_home="%%JAVA_HOME%%"}
: ${selenium_java_opts=""}
: ${selenium_user="selenium"}
: ${selenium_group="selenium"}
: ${selenium_jar="%%DATADIR%%/selenium-server-%%SELENIUM_VERSION%%.jar"}
: ${selenium_log_file="/var/log/selenium.log"}
pidfile="/var/run/selenium/selenium.pid"
command="/usr/sbin/daemon"
java_cmd="${selenium_java_home}/bin/java"
procname="${java_cmd}"
command_args="-p ${pidfile} ${java_cmd} ${selenium_java_opts} -jar ${selenium_jar} ${selenium_args} >> ${selenium_log_file} 2>&1"
required_files="${java_cmd}"
start_precmd="selenium_prestart"
start_cmd="selenium_start"
selenium_prestart() {
if [ ! -f "${selenium_log_file}" ]; then
touch "${selenium_log_file}"
chown "${selenium_user}:${selenium_group}" "${selenium_log_file}"
chmod 644 "${selenium_log_file}"
fi
if [ ! -d "/var/run/selenium" ]; then
install -d -o "${selenium_user}" -g "${selenium_group}" -m 750 "/var/run/selenium"
fi
}
selenium_start()
{
check_startmsgs && echo "Starting ${name}."
su -l ${selenium_user} -c "exec ${command} ${command_args}"
}
run_rc_command "$1"
|