From e6f997a7918d4e53f765b866d3775cc38d1a7ee5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Dec 2015 10:34:35 +0200 Subject: Add systemd-based setup instruction for periodic loader execution --- etc/buildfile | 8 ++++---- etc/systemd/brep-loader.service | 9 +++++++++ etc/systemd/brep-loader.timer | 23 +++++++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 etc/systemd/brep-loader.service create mode 100644 etc/systemd/brep-loader.timer (limited to 'etc') diff --git a/etc/buildfile b/etc/buildfile index fc192b6..c2db5cf 100644 --- a/etc/buildfile +++ b/etc/buildfile @@ -2,8 +2,8 @@ # copyright : Copyright (c) 2014-2015 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -define conf: file -conf{*}: extension = conf -conf{*}: install = data/etc +./: file{brep-module.conf brep-apache2.conf} \ +systemd/file{brep-loader.service brep-loader.timer} -./: conf{brep-module brep-apache2} +install = data/etc +systemd/: install = data/etc/systemd diff --git a/etc/systemd/brep-loader.service b/etc/systemd/brep-loader.service new file mode 100644 index 0000000..dec7944 --- /dev/null +++ b/etc/systemd/brep-loader.service @@ -0,0 +1,9 @@ +[Unit] +Description=brep repository loader service + +[Service] +Type=oneshot +ExecStart=/home/brep/install/bin/brep-loader /home/brep/config/brep-loader.conf + +[Install] +WantedBy=default.target diff --git a/etc/systemd/brep-loader.timer b/etc/systemd/brep-loader.timer new file mode 100644 index 0000000..22ff22b --- /dev/null +++ b/etc/systemd/brep-loader.timer @@ -0,0 +1,23 @@ +[Unit] +Description=brep repository loader timer +RefuseManualStart=no +RefuseManualStop=no + +[Timer] +Unit=brep-loader.service + +# Don't keep track of the timer across reboots. +# +Persistent=false + +# Wait 20 seconds until the first run. +# +OnBootSec=20 + +# Then wait 5 minutes until the next run. +# +OnUnitInactiveSec=5m + + +[Install] +WantedBy=timers.target -- cgit v1.1