Subject: Suggested patches for sysutils/ups-nut
To: None <tech-pkg@netbsd.org>
From: Julian Coleman <jdc@coris.demon.co.uk>
List: tech-pkg
Date: 10/13/2002 11:47:19
When installed and running, sysutils/ups-nut runs upslog, which logs to
/var/log/ups.  It would be nice if the log file was automatically rotated.
So, perhaps the appended patches could be applied (shamelessly stolen from
shells/bash2).

Thanks,

J

 ---8<---------------------------- Cut here ---------------------------->8---
--- Makefile.dist	Thu Oct  3 11:21:08 2002
+++ Makefile	Sun Oct 13 11:17:58 2002
@@ -68,6 +68,10 @@
 	${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${NUT_DOCDIR}
 	${INSTALL_DATA} ${WRKSRC}/docs/cables/*.txt ${NUT_DOCDIR}/cables
 	${INSTALL_DATA} ${WRKSRC}/docs/drivers/*.txt ${NUT_DOCDIR}/drivers
+	${TOUCH} /etc/newsyslog.conf
+	${CP} /etc/newsyslog.conf /etc/newsyslog.conf.bak
+	(${GREP} -v ${PREFIX}/bin/bash /etc/newsyslog.conf.bak || ${TRUE}; ${ECHO} "/var/log/ups		root:wheel	644  7    100  *    Z     /var/run/upslog.pid") >/etc/newsyslog.conf
+	${RM} /etc/newsyslog.conf.bak
 
 .include "../../mk/bsd.pkg.install.mk"
 .include "../../mk/bsd.pkg.mk"
--- PLIST.dist	Tue Aug 27 11:15:57 2002
+++ PLIST	Sun Oct 13 10:51:02 2002
@@ -1,4 +1,6 @@
 @comment $NetBSD: PLIST,v 1.10 2002/08/25 21:51:04 jlam Exp $
+@exec echo "updating /etc/newsyslog.conf"; cp /etc/newsyslog.conf /etc/newsyslog.conf.bak; (grep -v /var/log/ups /etc/newsyslog.conf.bak || true; echo "/var/log/ups		root:wheel	644  7    100  *    Z     /var/run/upslog.pid") >/etc/newsyslog.conf
+@unexec echo "updating /etc/newsyslog.conf"; cp /etc/newsyslog.conf /etc/newsyslog.conf.bak; (grep -v /var/log/ups /etc/newsyslog.conf.bak || true) >/etc/newsyslog.conf
 bin/upsc
 bin/upscmd
 bin/upsct
 ---8<---------------------------- Cut here ---------------------------->8---

-- 
                    My other computer also runs NetBSD
                          http://www.netbsd.org/