040166cdb7
- CrashPlan in place update can overwrite our run.conf preventing it from working [1] - Update to 3.6.4 PR: 194465 [1]
36 lines
935 B
Bash
36 lines
935 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
|
|
# PROVIDE: crashplan
|
|
# REQUIRE: DAEMON
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="crashplan"
|
|
rcvar=${name}_enable
|
|
|
|
crashplan_bin="%%PREFIX%%/share/crashplan/bin"
|
|
command="${crashplan_bin}/CrashPlanEngine"
|
|
pidfile="/var/run/CrashPlanEngine.pid"
|
|
|
|
crashplan_start() {
|
|
local crashplan_poll_selector
|
|
crashplan_poll_selector="-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.PollSelectorProvider"
|
|
|
|
/usr/bin/install -d /var/log/crashplan || exit 1
|
|
|
|
sed -E -e "s/-Djava.nio.channels.spi.SelectorProvider=[^[:blank:]]+//" \
|
|
-e "s/SRV_JAVA_OPTS=\"/SRV_JAVA_OPTS=\"${crashplan_poll_selector} /" \
|
|
-e "s/GUI_JAVA_OPTS=\"/GUI_JAVA_OPTS=\"${crashplan_poll_selector} /" \
|
|
-i bak "${crashplan_bin}/run.conf" || exit 1
|
|
|
|
/usr/bin/cpuset -l 0 ${command} start
|
|
}
|
|
|
|
start_cmd="${name}_start"
|
|
stop_cmd="${command} stop"
|
|
status_cmd="${command} status"
|
|
|
|
load_rc_config ${name}
|
|
run_rc_command "$1"
|