6

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"

2 Answers 2

7

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.

3
  • Is there a port for supervisord? make search name="supervisord" doesn't show any results.
    – Hank Gay
    Apr 20, 2010 at 20:50
  • 1
    Yup - it's actually called py-supervisor for some odd reason (sysutils/py-supervisor)
    – voretaq7
    Apr 20, 2010 at 21:03
  • 1
    Can you edit to put the name of the port in the answer proper? I'd do it myself, but my rep isn't high enough.
    – Hank Gay
    Apr 21, 2010 at 15:57
6

If you installed supervisord from the port sysutils/py-supervisor then this rc file is already present... (than to voretaq7 for pointing this out).

The basic framework of a rc file is:

#!/bin/sh

. /etc/rc.subr

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

command="/usr/local/bin/${name}"
command_args=""

run_rc_command "$1"

Creating the file /usr/local/etc/rc.d/supervisord with the above, then chmodding it +x will get you started (probably). I am assuming you have supervisord installed in /usr/local/bin, change that path as necessary. Also you can add any command line arguements you need (like a configuration file or whatever). I'm not familiar with supervisord, so I'm not sure what it needs.

Make sure you have a line in /etc/rc.conf similar to supervisord_enable="YES" or the script will do precisely nothing.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .