summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-09-18 10:22:39 +0200
committerErich Eckner <git@eckner.net>2019-09-18 10:22:39 +0200
commit13574649e92630f85a6e6d592b1cb4d9b128002f (patch)
tree53d3c757dbd08282fe555edc55bcb09267928883
parent1b7cabb8b940cb9e17a94bb173ebde6d70a3cae8 (diff)
downloadlogwatch-extra-13574649e92630f85a6e6d592b1cb4d9b128002f.tar.xz
systemd unit and timer new
-rw-r--r--.gitignore1
-rw-r--r--Makefile6
-rw-r--r--doalogwatch.service.in5
-rw-r--r--doalogwatch.timer11
4 files changed, 21 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 5444b6e..9d0139f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
doalogwatch
doalogwatch.cron
+doalogwatch.service
diff --git a/Makefile b/Makefile
index ab96e3e..278cafa 100644
--- a/Makefile
+++ b/Makefile
@@ -27,11 +27,12 @@ CACHEDIR = /var/cache
MANDIR = /usr/share/man
LOGWATCHDIR = /usr/share/logwatch
TMPDIR = /tmp
+SYSTEMDDIR = /usr/share/systemd/system
WAITDIR = /home/shutdown/.warteauf
VERSION = 0.8.2
-all: doalogwatch doalogwatch.cron
+all: doalogwatch doalogwatch.cron doalogwatch.service
%: %.in
sed "s/#VERSION#/$(VERSION)/; \
@@ -43,11 +44,12 @@ all: doalogwatch doalogwatch.cron
s@#TMPDIR#@$(TMPDIR)@" \
$< > $@
-.PHONY: install dist clean
+.PHONY: all install dist clean
install: all
install -D -m0755 -t $(DESTDIR)$(BINDIR) doalogwatch
install -D -m0755 doalogwatch.cron $(DESTDIR)$(CRONDIR)/doalogwatch
+ install -D -m0655 -t $(DESTDIR)$(SYSTEMDDIR) doalogwatch.service doalogwatch.timer
install -d $(DESTDIR)$(CACHEDIR)/logwatch
install -D -m0644 -t $(DESTDIR)$(LOGWATCHDIR)/default.conf/services dummy.conf
install -D -m0644 -t $(DESTDIR)$(LOGWATCHDIR)/scripts/services dummy
diff --git a/doalogwatch.service.in b/doalogwatch.service.in
new file mode 100644
index 0000000..9ad9619
--- /dev/null
+++ b/doalogwatch.service.in
@@ -0,0 +1,5 @@
+[Unit]
+Description=report a logwatch
+
+[Service]
+ExecStart=#BINDIR#/doalogwatch
diff --git a/doalogwatch.timer b/doalogwatch.timer
new file mode 100644
index 0000000..79207f8
--- /dev/null
+++ b/doalogwatch.timer
@@ -0,0 +1,11 @@
+[Unit]
+Description=repeatedly try to report a logwatch
+
+[Timer]
+AccuracySec=1us
+RandomizedDelaySec=1h
+OnCalendar=*-*-* *:00:00
+Persistent=true
+
+[Install]
+WantedBy=timers.target