ports/www/selenium/files/selenium.in
Einar Bjarni Halldórsson 5e92d4485c www/selenium: Update to 4.1.3
ChangeLog: https://github.com/SeleniumHQ/selenium/releases/tag/selenium-4.1.0

Add UPDATING note to warn about parameter change in rc.conf

PR:	263081
Reported by:	einar@isnic.is
Approved by:	daniel@blodan.se (maintainer)
2022-06-20 22:47:59 +02:00

51 lines
1.4 KiB
Bash

#!/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"