summaryrefslogtreecommitdiff
path: root/sysutils/nut/files
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2019-03-23 19:34:07 +0000
committerCy Schubert <cy@FreeBSD.org>2019-03-23 19:34:07 +0000
commit64a44f199ea7913276590e3178d334c15809c05a (patch)
tree5b376b266801ace83c0f8b975d0b4babd603a794 /sysutils/nut/files
parentdatabases/freetds-devel: Update version 1.1.4=>1.1.19 (diff)
Move default log location so it can be rotated without root privileges.
Add syslog.conf and newsyslog.conf files for installation into their respective .d directories in $PREFIX. Allow upslog log format to be customized. PR: 236700 Submitted by: Daniel O'Connor <darius@dons.net.au> (90%)
Diffstat (limited to 'sysutils/nut/files')
-rw-r--r--sysutils/nut/files/nut.newsyslog7
-rw-r--r--sysutils/nut/files/nut.syslog2
-rw-r--r--sysutils/nut/files/nut_upslog.in5
3 files changed, 12 insertions, 2 deletions
diff --git a/sysutils/nut/files/nut.newsyslog b/sysutils/nut/files/nut.newsyslog
new file mode 100644
index 000000000000..fc50b6c1be32
--- /dev/null
+++ b/sysutils/nut/files/nut.newsyslog
@@ -0,0 +1,7 @@
+# configuration file for newsyslog for nut
+#
+# see newsyslog.conf(5) for details
+#
+# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
+/var/log/nut/upsd.log uucp:uucp 644 7 100 * J /var/db/nut/upslog.pid
+
diff --git a/sysutils/nut/files/nut.syslog b/sysutils/nut/files/nut.syslog
new file mode 100644
index 000000000000..c9587148aab1
--- /dev/null
+++ b/sysutils/nut/files/nut.syslog
@@ -0,0 +1,2 @@
+!upsmon
+*.* /var/log/nut/upsd.log
diff --git a/sysutils/nut/files/nut_upslog.in b/sysutils/nut/files/nut_upslog.in
index 8637340b8a1c..7f65bd866982 100644
--- a/sysutils/nut/files/nut_upslog.in
+++ b/sysutils/nut/files/nut_upslog.in
@@ -17,9 +17,10 @@
#
nut_upslog_enable=${nut_upslog_enable:-"NO"}
nut_upslog_prefix=${nut_upslog_prefix:-"%%PREFIX%%"}
-nut_upslog_logfile=${nut_upslog_logfile:-"/var/log/ups.log"}
+nut_upslog_logfile=${nut_upslog_logfile:-"/var/log/nut/ups.log"}
nut_upslog_interval=${nut_upslog_interval:-"300"}
nut_upslog_ups=${nut_upslog_ups:-"myups@localhost"}
+# nut_upslog_format
. /etc/rc.subr
@@ -31,6 +32,6 @@ load_rc_config $name
required_dirs="%%STATEDIR%%"
command="${nut_upslog_prefix}/bin/upslog"
pidfile="%%STATEDIR%%/upslog.pid"
-nut_upslog_flags=${nut_upslog_flags:-"-s ${nut_upslog_ups} -l ${nut_upslog_logfile} -i ${nut_upslog_interval}"}
+nut_upslog_flags=${nut_upslog_flags:-"-s ${nut_upslog_ups} -l ${nut_upslog_logfile} -i ${nut_upslog_interval} ${nut_upslog_format:+-f \"${nut_upslog_format}\"}"}
run_rc_command "$1"