aboutsummaryrefslogtreecommitdiff
path: root/misc/py-cinder/files/cinder-api.in
blob: d3eacd51ab63535c6099a2519cd908b9ac8eb0e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: cinder_api
# REQUIRE: LOGIN
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable cinder_api:
#
# cinder_api_enable="YES"
#
# cinder_api_enable (bool):
#	Set it to "YES" to enable cinder_api.
# 	Default is "NO".
#
# cinder_api_logdir (str):
#	Set it to chagge log directory
#	Default is "/var/log/cinder"
#
# cinder_api_args (str):
#	Set it to change command line arguments.
#	Default is "--log-file ${cinder_api_logdir}/cinder-api.log"
#

. /etc/rc.subr

name=cinder_api
rcvar=cinder_api_enable

PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH

pidfile="/var/run/cinder-api.pid"
procname="%%PREFIX%%/bin/python2.7"

start_precmd=cinder_precmd

load_rc_config $name

: ${cinder_api_enable:="NO"}
: ${cinder_api_logdir:="/var/log/cinder"}
: ${cinder_api_args:="--log-file ${cinder_api_logdir}/cinder-api.log"}

command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} cinder-api ${cinder_api_args}"

cinder_precmd() {
	mkdir -p ${cinder_api_logdir}
}

run_rc_command "$1"