opnsense-ports/emulators/py-nova/files/nova-api.in
Franco Fichtner 65a742671f */*: sync with upstream
Taken from: FreeBSD
2016-12-18 10:25:29 +01:00

53 lines
977 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nova_api
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nova_api:
#
# nova_api_enable="YES"
#
# nova_api_enable (bool):
# Set it to "YES" to enable nova_api.
# Default is "NO".
#
# nova_api_logdir (str):
# Set it to chagge log directory
# Default is "/var/log/nova"
#
# nova_api_args (str):
# Set it to change command line arguments.
# Default is "--log-file ${nova_api_logdir}/nova-api.log"
#
. /etc/rc.subr
name=nova_api
rcvar=nova_api_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/nova-api.pid"
procname="%%PREFIX%%/bin/python2.7"
start_precmd=nova_precmd
load_rc_config $name
: ${nova_api_enable:="NO"}
: ${nova_api_logdir:="/var/log/nova"}
: ${nova_api_args:="--log-file ${nova_api_logdir}/nova-api.log"}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} nova-api ${nova_api_args}"
nova_precmd() {
mkdir -p ${nova_api_logdir}
}
run_rc_command "$1"