Freebsd – How to automatically start supervisor on boot in FreeBSD

freebsdrc.dsupervisord

Is there a pre-existing startup script for supervisord on FreeBSD? If not, is there a good guide for writing rc.d scripts for FreeBSD? I'm pretty new to the platform.

Thanks.

UPDATE:

I now have the following in /usr/local/etc/rc.d/supervisord, but it doesn't seem to be working. I'm not seeing anything in the startup scroll related to supervisord.

#!/bin/sh

# PROVIDE: supervisord
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="supervisord"
rcvar=`set_rcvar`
load_rc_config "$name"

command="/usr/local/bin/${name}"
command_args="-c /usr/local/etc/supervisord.conf"

supervisord_enable=${supervisord_enable-"NO"}
supervisord_pidfile=${supervisord_pidfile-"/var/run/supervisord.pid"}

pidfile="${supervisord_pidfile}"

run_rc_command "$1"

Best Answer

If you installed supervisord from ports (sysutils/py-supervisor) you should have a functioning rc script in /usr/local/etc/rc.d/supervisord

Check the script for info/other configuration parameters, but simply adding supervisord_enable="YES" to /etc/rc.conf should be all you need to do to make it start automatically on boot.