From 52a84b5635bb75676ed83ffdaf04cf3023705e24 Mon Sep 17 00:00:00 2001 From: Dan Langille Date: Fri, 17 Feb 2023 14:20:16 +0000 Subject: [PATCH] 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) --- net-mgmt/icingaweb2-module-vspheredb/Makefile | 2 +- .../icingaweb2-module-vspheredb/files/vspheredb.in | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/net-mgmt/icingaweb2-module-vspheredb/Makefile b/net-mgmt/icingaweb2-module-vspheredb/Makefile index 552b4064b023..38ba5772b43f 100644 --- a/net-mgmt/icingaweb2-module-vspheredb/Makefile +++ b/net-mgmt/icingaweb2-module-vspheredb/Makefile @@ -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} diff --git a/net-mgmt/icingaweb2-module-vspheredb/files/vspheredb.in b/net-mgmt/icingaweb2-module-vspheredb/files/vspheredb.in index 0e122458400b..83b8228b1963 100755 --- a/net-mgmt/icingaweb2-module-vspheredb/files/vspheredb.in +++ b/net-mgmt/icingaweb2-module-vspheredb/files/vspheredb.in @@ -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"