From 0092195f928e9b1fd18793fb526d582a2934d514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Wed, 22 Aug 2018 16:27:01 +0200 Subject: [PATCH] Add systemd units and bump package version --- Makefile | 6 ++++-- debian/changelog | 7 +++++++ unipoly-mlmmj-ldap-sync.rb => unipoly-mlmmj-ldap-sync | 2 +- unipoly-mlmmj-ldap-sync.service | 7 +++++++ unipoly-mlmmj-ldap-sync.timer | 9 +++++++++ 5 files changed, 28 insertions(+), 3 deletions(-) rename unipoly-mlmmj-ldap-sync.rb => unipoly-mlmmj-ldap-sync (98%) create mode 100644 unipoly-mlmmj-ldap-sync.service create mode 100644 unipoly-mlmmj-ldap-sync.timer diff --git a/Makefile b/Makefile index 05ca64d..4029053 100644 --- a/Makefile +++ b/Makefile @@ -3,5 +3,7 @@ PREFIX ?= /usr build: install: - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp unipoly-mlmmj-ldap-sync.rb $(DESTDIR)$(PREFIX)/bin/unipoly-mlmmj-ldap-sync + mkdir -p $(DESTDIR)$(PREFIX)/bin /etc /lib/systemd/system + install -m755 unipoly-mlmmj-ldap-sync $(DESTDIR)$(PREFIX)/bin/unipoly-mlmmj-ldap-sync + install -m644 config.example.com /etc/unipoly-mlmmj-ldap-sync.toml + install -m644 unipoly-mlmmj-ldap-sync.service unipoly-mlmmj-ldap-sync.timer /lib/systemd/system diff --git a/debian/changelog b/debian/changelog index 53fa052..44fbed9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +unipoly-mlmmj-ldap-sync (0.2) unstable; urgency=low + + * Add systemd units. + * Add default configuration file. + + -- Timothée Floure Wed, 22 Aug 2018 16:25:00 +0200 + unipoly-mlmmj-ldap-sync (0.1) unstable; urgency=low * Let there be package. diff --git a/unipoly-mlmmj-ldap-sync.rb b/unipoly-mlmmj-ldap-sync similarity index 98% rename from unipoly-mlmmj-ldap-sync.rb rename to unipoly-mlmmj-ldap-sync index a522f70..6daf202 100755 --- a/unipoly-mlmmj-ldap-sync.rb +++ b/unipoly-mlmmj-ldap-sync @@ -3,7 +3,7 @@ require 'toml' require 'net/ldap' -@configuration_file = "conf.example.toml" +@configuration_file = "/etc/unipoly-mlmmj-ldap-sync.toml" def read_configuration(path) TOML.load_file(path) diff --git a/unipoly-mlmmj-ldap-sync.service b/unipoly-mlmmj-ldap-sync.service new file mode 100644 index 0000000..f82c859 --- /dev/null +++ b/unipoly-mlmmj-ldap-sync.service @@ -0,0 +1,7 @@ +[Unit] +Description=Synchronize Unipoly's mailing lists with their LDAP groups +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/unipoly-mlmmj-ldap-sync diff --git a/unipoly-mlmmj-ldap-sync.timer b/unipoly-mlmmj-ldap-sync.timer new file mode 100644 index 0000000..4ec67c9 --- /dev/null +++ b/unipoly-mlmmj-ldap-sync.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Synchronize Unipoly's mailing lists with their LDAP groups once a day + +[Timer] +OnCalendar=*-*-* 3:00:00 +Persistent=true + +[Install] +WantedBy=timers.target