aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/librenms
diff options
context:
space:
mode:
authorDan Langille <dvl@FreeBSD.org>2020-07-26 17:48:41 +0000
committerDan Langille <dvl@FreeBSD.org>2020-07-26 17:48:41 +0000
commit538b425cc383bd985bc01693408173c4ad94d2d4 (patch)
tree32996069e18493decde60420fb0ad3a63aacec1f /net-mgmt/librenms
parent9b06d441b656a7a698b5694735a34097100b547c (diff)
downloadports-538b425cc383bd985bc01693408173c4ad94d2d4.tar.gz
ports-538b425cc383bd985bc01693408173c4ad94d2d4.zip
Fix double logging
HEADS UP: See UPDATING for changes affecting your upgrade. New installs not affected. This patch adds a new rc_variable: librenms_daemonflags The -T option is gone as that will force a log to syslog, doubling up on log entries. A new APP_LOG setting has been added to the .env file. Please update and move your logs. See UPDATING. PR: 246598 Submitted by: Dries Michiels <driesm.michiels@gmail.com>
Notes
Notes: svn path=/head/; revision=543487
Diffstat (limited to 'net-mgmt/librenms')
-rw-r--r--net-mgmt/librenms/Makefile6
-rw-r--r--net-mgmt/librenms/files/librenms.in5
-rw-r--r--net-mgmt/librenms/files/patch-.env.example5
-rw-r--r--net-mgmt/librenms/files/pkg-message.in5
4 files changed, 15 insertions, 6 deletions
diff --git a/net-mgmt/librenms/Makefile b/net-mgmt/librenms/Makefile
index c082bbc2339e..6bff72f8baf5 100644
--- a/net-mgmt/librenms/Makefile
+++ b/net-mgmt/librenms/Makefile
@@ -3,7 +3,7 @@
PORTNAME= librenms
PORTVERSION= 1.65.1
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= net-mgmt
MASTER_SITES= LOCAL/dvl:vendor
@@ -109,7 +109,7 @@ ROOT_FILES= addhost.php adduser.php alerts.php artisan billing-calculate.php \
SCRIPT_FILES= daily.sh lnms
-ROOT_DIRS= LibreNMS app bootstrap config contrib database doc html includes licenses logs mibs misc resources routes scripts sql-schema storage tests
+ROOT_DIRS= LibreNMS app bootstrap config contrib database doc html includes licenses mibs misc resources routes scripts sql-schema storage tests
# these are directories which require a generic @DIR entry in pkg-plist
OTHER_DIRS= html/js/lang \
@@ -134,6 +134,7 @@ post-patch:
@${REINPLACE_CMD} 's|%%PORTVERSION%%|${PORTVERSION}|g' ${WRKSRC}/includes/common.php
@${REINPLACE_CMD} 's|%%RELEASE_TIMESTAMP%%|${RELEASE_TIMESTAMP}|g' ${WRKSRC}/includes/common.php
@${RM} ${WRKSRC}/LibreNMS/Validations/Updates.php
+ @${RM} -rf ${WRKSRC}/logs
do-install:
${MKDIR} ${STAGEDIR}/${WWWDIR}
@@ -186,7 +187,6 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/.env.example ${STAGEDIR}/${WWWDIR}
@${ECHO_CMD} "@(root,www,0750) ${WWWDIR}/.env.example" >> ${TMPPLIST}
- @${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/logs" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/bootstrap/cache" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/storage" >> ${TMPPLIST}
@${ECHO_CMD} "@dir(www,www,0775) ${WWWDIR}/storage/framework/cache" >> ${TMPPLIST}
diff --git a/net-mgmt/librenms/files/librenms.in b/net-mgmt/librenms/files/librenms.in
index 2c866f005c6b..958f2cac0788 100644
--- a/net-mgmt/librenms/files/librenms.in
+++ b/net-mgmt/librenms/files/librenms.in
@@ -17,6 +17,8 @@
# Default: %%GROUP%%
# librenms_pid: Path of the pid file.
# Default /var/run/librenms/librenms.pid
+# librenms_daemonflags: Flags passed to daemon(8), overwrite this to use eg syslog
+# Default "-o /var/log/librenms/librenms-service.log"
#
# Contributed by: Dries Michiels (driesm.michiels@gmail.com)
@@ -31,6 +33,7 @@ load_rc_config $name
: ${librenms_user:="%%USER%%"}
: ${librenms_group:="%%GROUP%%"}
: ${librenms_pid:="/var/run/librenms/librenms.pid"}
+: ${librenms_daemonflags:="-o /var/log/$name/$name-service.log"}
pidfile="$librenms_pid"
procname="%%PYTHON%%"
@@ -44,6 +47,6 @@ librenms_precmd()
[ -f /var/log/$name/$name.log ] || install -g $librenms_group -o $librenms_user -m 644 /dev/null /var/log/$name/$name.log
}
-command_args="-T $name -o /var/log/$name/$name-service.log -p $pidfile $procname %%WWWDIR%%/librenms-service.py"
+command_args="$librenms_daemonflags -p $pidfile $procname %%WWWDIR%%/librenms-service.py"
run_rc_command "$1"
diff --git a/net-mgmt/librenms/files/patch-.env.example b/net-mgmt/librenms/files/patch-.env.example
index fd10eaab380f..d2d5ff8499de 100644
--- a/net-mgmt/librenms/files/patch-.env.example
+++ b/net-mgmt/librenms/files/patch-.env.example
@@ -1,6 +1,6 @@
---- .env.example.orig 2019-01-11 21:46:24 UTC
+--- .env.example.orig 2020-07-10 19:56:16 UTC
+++ .env.example
-@@ -1,8 +1,12 @@
+@@ -1,8 +1,13 @@
APP_KEY=
-#DB_HOST=
@@ -17,3 +17,4 @@
+DB_PORT=3306
+LIBRENMS_USER=www
+
++APP_LOG=/var/log/librenms/librenms.log
diff --git a/net-mgmt/librenms/files/pkg-message.in b/net-mgmt/librenms/files/pkg-message.in
index 35aba0facc90..0ebb82513216 100644
--- a/net-mgmt/librenms/files/pkg-message.in
+++ b/net-mgmt/librenms/files/pkg-message.in
@@ -106,6 +106,11 @@ For more information, see pkg info --pkg-message librenms
You probably want to install lang/python3 to get validate.php clean.
+Logs have been relocated to /var/log/librenms - see UPDATING 20200726
+Logs which were going to /var/log/messages and /var/log/librenms/ now only go
+to /var/log/librenms/
+
+
EOM
}
]