mirror of
https://git.freebsd.org/ports.git
synced 2025-06-10 15:20:32 -04:00
- Changed MASTER_SITES to the official upstream repository - Added LICENSE_FILE - Enabled building for Python 3+ ports - Removed RC script glance-glare because it's no longer required - Sorted variables a bit according to the PHB - Added OPTIONS for DOCS, MySQL, PostgreSQL, memcached and MongoDB - Added post-extract, post-patch and post-install targets to replace hardcoded occurences of /etc with ${PREFIX}/etc and to handle the installation of files into ${ETCDIR} - Added pkg-message PR: 232244 Submitted by: freebsd_ports@k-worx.org Approved by: maintainer Sponsored by: iXsystems Inc.
61 lines
1.2 KiB
Bash
61 lines
1.2 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: glance_api
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
|
|
#
|
|
# Add the following lines to /etc/rc.conf to enable glance_api:
|
|
#
|
|
# glance_api_enable="YES"
|
|
#
|
|
# glance_api_enable (bool):
|
|
# Set it to "YES" to enable glance_api.
|
|
# Default is "NO".
|
|
#
|
|
# glance_api_logdir (str):
|
|
# Set it to chagge log directory
|
|
# Default is "/var/log/glance"
|
|
#
|
|
# glance_api_args (str):
|
|
# Set it to change command line arguments.
|
|
# Default is "--log-file ${glance_api_logdir}/glance-api.log"
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=glance_api
|
|
rcvar=glance_api_enable
|
|
|
|
required_files=%%PREFIX%%/etc/glance/glance-api.conf
|
|
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
|
|
|
|
pidfile="/var/run/glance-api.pid"
|
|
procname="%%PREFIX%%/bin/python%%PYTHON_VER%%"
|
|
|
|
start_precmd=glance_precmd
|
|
stop_postcmd=glance_postcmd
|
|
|
|
load_rc_config $name
|
|
|
|
: ${glance_api_enable:="NO"}
|
|
: ${glance_api_logdir:="/var/log/glance"}
|
|
: ${glance_api_args:="--log-file ${glance_api_logdir}/glance-api.log"}
|
|
|
|
command="/usr/sbin/daemon"
|
|
command_args="-f -p ${pidfile} -u glance glance-api ${glance_api_args}"
|
|
|
|
glance_precmd() {
|
|
mkdir -p ${glance_api_logdir}
|
|
chown glance ${glance_api_logdir}
|
|
}
|
|
|
|
glance_postcmd() {
|
|
# this is a workaround for a glance-api bug
|
|
pkill -u glance -f glance-api
|
|
}
|
|
|
|
run_rc_command "$1"
|