An rc.d startup script for Crashplan running on FreeBSD


I have CrashPlan running on a couple FreeBSD servers now, and I thought I’d write up a quick startup rc script.
Here’s what we’ll do. This assumes you’ve installed CrashPlan in the default directory, which requires the “/compat/linux/bin/bash” environment.

1. Create a startup script in /etc/rc.d called “crashplan”. Put the contents below in the script.

#!/bin/sh

. /etc/rc.subr

name="crashplan"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
pidfile="/compat/linux/usr/local/crashplan/CrashPlanEngine.pid"

crashplan_start()
{
echo "Initializing CrashPlan Service ..."
/compat/linux/bin/bash /usr/local/crashplan/bin/CrashPlanEngine start
}

crashplan_stop()
{
echo "Initiating CrashPlan Service shutdown..."
/compat/linux/bin/bash /usr/local/crashplan/bin/CrashPlanEngine stop
}

load_rc_config ${name}
run_rc_command "${1}"

2. Make it executable:

chmod 755 /etc/rc.d/crashplan

3. Edit your /etc/rc.conf file and add:

crashplan_enable="YES"

Test by running :

/etc/rc.d/crashplan start

If all goes well, when you restart the system it should bring up CrashPlan for you.

In case you haven’t seen it, here’s the install how-to for Crashplan on FreeBSD.

https://www.1stbyte.com/2011/01/26/how-to-install-crashplan-on-freebsd/