Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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"
share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
Is there a port for supervisord? make search name="supervisord" doesn't show any results. –  Hank Gay Apr 20 '10 at 20:50
1  
Yup - it's actually called py-supervisor for some odd reason (sysutils/py-supervisor) –  voretaq7 Apr 20 '10 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 '10 at 15:57
add comment

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.

share|improve this answer
1  
See also this article on writing FreeBSD rc scripts: freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting -- Everything you ever wanted to know about the RC system but were afraid to ask. –  voretaq7 Apr 20 '10 at 20:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.