From e3b19b185897f147218088161aeb30b8aa4e8201 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 19 Apr 2019 17:49:25 +0200 Subject: systemd service and timer file new --- .gitignore | 1 + Makefile | 3 ++- digest-mailer.service.in | 6 ++++++ digest-mailer.timer | 11 +++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 digest-mailer.service.in create mode 100644 digest-mailer.timer diff --git a/.gitignore b/.gitignore index 8450088..4a6efec 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ digest-mailer man.commons *.common *.conf +*.service *.1 diff --git a/Makefile b/Makefile index dca30a7..0079eb0 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ MANDIR = /usr/share/man VERSION = 0.3 -all: man.commons digest-mailer digest-mailer.1 digest-mailer.conf +all: man.commons digest-mailer digest-mailer.1 digest-mailer.conf digest-mailer.service %: %.in sed " \ @@ -52,6 +52,7 @@ install: all install -D -m0755 digest-mailer $(DESTDIR)$(BINDIR)/digest-mailer install -D -m0644 digest-mailer.1 $(DESTDIR)$(MANDIR)/man1/digest-mailer.1 install -D -m0644 digest-mailer.conf $(DESTDIR)$(ETCDIR)/digest-mailer.conf + install -D -m0644 -t $(DESTDIR)$(LIBDIR)/systemd/system/ digest-mailer.service digest-mailer.timer clean: ls -A | \ diff --git a/digest-mailer.service.in b/digest-mailer.service.in new file mode 100644 index 0000000..7c5d803 --- /dev/null +++ b/digest-mailer.service.in @@ -0,0 +1,6 @@ +[Unit] +Description=send mail digest + +[Service] +Type=oneshot +ExecStart=#BINDIR#/digest-mailer -f diff --git a/digest-mailer.timer b/digest-mailer.timer new file mode 100644 index 0000000..d38d7de --- /dev/null +++ b/digest-mailer.timer @@ -0,0 +1,11 @@ +[Unit] +Description=repeatedly send mail digest + +[Timer] +AccuracySec=1us +RandomizedDelaySec=4min +OnUnitInactiveSec=4min +OnBootSec=4min + +[Install] +WantedBy=timers.target -- cgit v1.2.3-54-g00ecf