freebsd-ports/misc/py-glance/files/glance-glare.in
Roman Bogorodskiy 4ccb86a7b4 misc/py-glance: rc scripts improvement
- run glance services as 'glance' user instead of 'root'
 - fix an issue with stopping of the glance-api service
   (where it was spawning a new glance-api worker on SIGTERM)
 - automatically create log directories
 - add glance-glare rc script
 - bump PORTREVISION

PR:		214741
Submitted by:	maintainer
2016-11-27 11:58:23 +00:00

55 lines
1.1 KiB
Bash

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