From 89cb215f417a3156fd48a8f1c13248f922e8076a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Wed, 30 Oct 2019 15:51:43 +0100 Subject: [PATCH] Add new systemd units (supporting custom paths) --- Makefile | 1 + debian/changelog | 2 +- mlmmj-ldap-sync@.service | 7 +++++++ mlmmj-ldap-sync@.timer | 9 +++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 mlmmj-ldap-sync@.service create mode 100644 mlmmj-ldap-sync@.timer diff --git a/Makefile b/Makefile index a299bf4..ce16a2c 100644 --- a/Makefile +++ b/Makefile @@ -7,3 +7,4 @@ install: install -m755 mlmmj-ldap-sync $(DESTDIR)$(PREFIX)/bin/mlmmj-ldap-sync install -m644 conf.example.toml /etc/mlmmj-ldap-sync.toml install -m644 mlmmj-ldap-sync.service mlmmj-ldap-sync.timer /lib/systemd/system + install -m644 mlmmj-ldap-sync@.service mlmmj-ldap-sync@.timer /lib/systemd/system diff --git a/debian/changelog b/debian/changelog index c00a2dd..d6413e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ mlmmj-ldap-sync (0.5) unstable; urgency=medium * Rename package from unipoly-mlmmj-ldap-sync to mlmmj-ldap-sync. - * Allow multiple configurations. + * Support custom path for the configuration file. -- Timothée Floure Wed, 30 Oct 2019 12:20:01 +0100 diff --git a/mlmmj-ldap-sync@.service b/mlmmj-ldap-sync@.service new file mode 100644 index 0000000..f1bf483 --- /dev/null +++ b/mlmmj-ldap-sync@.service @@ -0,0 +1,7 @@ +[Unit] +Description=Synchronize mlmmj mailing lists with LDAP groups +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/mlmmj-ldap-sync /etc/mlmmj-ldap-sync-%i.toml diff --git a/mlmmj-ldap-sync@.timer b/mlmmj-ldap-sync@.timer new file mode 100644 index 0000000..3b99c39 --- /dev/null +++ b/mlmmj-ldap-sync@.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Synchronize mlmmj mailing lists with LDAP groups once a day + +[Timer] +OnCalendar=*-*-* 3:00:00 +Persistent=true + +[Install] +WantedBy=timers.target