net-mgmt/icingaweb2-module-vspheredb: allow flags in rc.d script

Add vspheredb_flags to rc.d script allowing users to choose which
daemon(8) they wish to use. My use case is:

  vspheredb_flags="-o /var/log/vspheredb.log"

Which logs the output of the daemon to the specified file.

See man(8) daemon for more information.

Approved by:	maintainer (via private communication)
This commit is contained in:
Dan Langille 2023-02-17 14:20:16 +00:00
parent e86cd62dba
commit 52a84b5635
2 changed files with 8 additions and 4 deletions

View file

@ -1,7 +1,7 @@
PORTNAME= icingaweb2-module-vspheredb
DISTVERSIONPREFIX= v
DISTVERSION= 1.4.0
PORTREVISION= 2
PORTREVISION= 1
CATEGORIES= net-mgmt www
PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX}

View file

@ -5,10 +5,12 @@
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nsca:
# Add the following lines to /etc/rc.conf to enable vspheredb:
# vspheredb (bool): Set to "NO" by default.
# Set it to "YES" to enable .
#
# vspheredb_flags (string): defaults to -f
# see man(8) daemon for more information
. /etc/rc.subr
@ -17,8 +19,10 @@ rcvar=vspheredb_enable
pidfile="/var/run/vspheredb.pid"
command="/usr/sbin/daemon"
command_args="-f -P ${pidfile} %%PREFIX%%/bin/icingacli vspheredb daemon run"
load_rc_config "${name}"
: ${vspheredb_flags:="-f"}
command_args="${vspheredb_flags} -P ${pidfile} /usr/local/bin/icingacli vspheredb daemon run"
run_rc_command "$1"