#!/bin/sh # # PROVIDE: markdown # REQUIRE: DAEMON # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable buildbot: # buildbot_enable="YES" # Below setting will be used if exist. If not enabled or the # user does not exist then user will be root to ensure that # the service starts. markdown_runas_user="www" markdown_enable=${markdown_enable-"NO"} . /etc/rc.subr name="markdown" rcvar=`set_rcvar` command="/usr/local/cms/build/markdownd.py" command_env="PYTHONPATH=/usr/local/cms/build MARKDOWN_SOCKET=/usr/local/cms/logs/markdown.socket" if [ $markdown_runas_user ]; then run_as="${command_env} /usr/local/bin/sudo -E -u ${markdown_runas_user}" else run_as="${command_env}" fi load_rc_config ${name} start_cmd="${run_as} ${command}" stop_cmd="/bin/pkill -u www python" run_rc_command "$1"