From 76bc66df08d29254a5096c1b5865b39bced9c3ee Mon Sep 17 00:00:00 2001 From: Dan Langille Date: Wed, 28 Apr 2021 20:55:11 +0000 Subject: Install a newsyslog config file to rotate Librenms logs. PR: 255427 Reported by: James French --- net-mgmt/librenms/Makefile | 6 ++++++ net-mgmt/librenms/files/newsyslog.conf.sample | 7 +++++++ net-mgmt/librenms/files/pkg-message.in | 7 +++++++ 3 files changed, 20 insertions(+) create mode 100644 net-mgmt/librenms/files/newsyslog.conf.sample diff --git a/net-mgmt/librenms/Makefile b/net-mgmt/librenms/Makefile index 7cb6d8910d6b..9706fe5adbc4 100644 --- a/net-mgmt/librenms/Makefile +++ b/net-mgmt/librenms/Makefile @@ -2,6 +2,7 @@ PORTNAME= librenms PORTVERSION= 21.4.0 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= net-mgmt MASTER_SITES= LOCAL/dvl:vendor @@ -194,4 +195,9 @@ post-install: @${ECHO_CMD} "@dir(root,www,0775) ${WWWDIR}/${f}" >> ${TMPPLIST} .endfor + @${MKDIR} ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d + ${INSTALL_DATA} ${FILESDIR}/newsyslog.conf.sample ${STAGEDIR}/${WWWDIR}/contrib/newsyslog.conf.sample + @${ECHO_CMD} "@dir etc/newsyslog.conf.d" >> ${TMPPLIST} + @${ECHO_CMD} "@sample ${WWWDIR}/contrib/newsyslog.conf.sample etc/newsyslog.conf.d/librenms.conf" >> ${TMPPLIST} + .include diff --git a/net-mgmt/librenms/files/newsyslog.conf.sample b/net-mgmt/librenms/files/newsyslog.conf.sample new file mode 100644 index 000000000000..9420d72da579 --- /dev/null +++ b/net-mgmt/librenms/files/newsyslog.conf.sample @@ -0,0 +1,7 @@ +# configuration file for newsyslog for librenms +# +# see newsyslog.conf(5) for details +# +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +/var/log/librenms/librenms.log www:www 644 7 * $D0 J /var/run/librenms/librenms.pid +/var/log/librenms/librenms-service.log www:www 644 7 * $D0 J /var/run/librenms/librenms.pid diff --git a/net-mgmt/librenms/files/pkg-message.in b/net-mgmt/librenms/files/pkg-message.in index 0ebb82513216..b0944c13e761 100644 --- a/net-mgmt/librenms/files/pkg-message.in +++ b/net-mgmt/librenms/files/pkg-message.in @@ -11,6 +11,8 @@ with the following notes: NOTE: setting sql-mode="" is no longer required. You can remove it from /usr/local/etc/mysql/my.cnf +However, 'lower_case_table_names=0' is required. + HEADS UP Polling via cron job has been removed.. Please use the Dispatcher. @@ -28,6 +30,11 @@ The service will log to /var/log/librems/librenms-service.log see also https://docs.librenms.org/Extensions/Dispatcher-Service/ +For log file rotation + +* sample file installed to %%WWWDIR%%/contrib/newsyslog.conf.sample +* actual file installed, never overwriting, to %%PREFIX%%/etc/newsyslog.conf.d/librenms.conf + When converting from PYPOLLER to the Dispatcher Service (PYSERVICE), these steps will help you get started: -- cgit v1.2.3