Commit 97eefd7b authored by Jonathan Michalon's avatar Jonathan Michalon
Browse files

Provide a systemd templated unit

With systemd it's easy to manage several instances of picomon (via templated
units) so this should be quite usefull.
Also we switch to /etc/picomon for config (instead of %prefix%/etc/picomon)
as /usr/local/etc don't seem to exist for real and that way it's not abnormal
to ship the unit in /etc too. Also it's easier to manage the config at only
one place (think about etckeeper etc.).
parent 8bf86754
......@@ -101,11 +101,13 @@ A small watchdog is distributed which will send an email in case the main daemon
process exits (OOM, bug, etc.) to the same addresses than those used for check
status notifications. You may tune the subject with the config option `emails.watchdog_subject`.
For now, no sysv initscript / systemd unit / whatever for such a small daemon exists.
One simple way to run it is to use something like the following in `/etc/rc.local`
You have to run one picomon instance per config file.
A templated systemd unit is provided. For any configuration file you write you should be able to manage
the corresponding systemd service like usual (picomon@`name`.service).
Otherwise one simple way is something like the following in `/etc/rc.local`
(assuming a standard system-wide install with ` install`):
for conf in /usr/local/etc/picomon/*.py; do sudo -u nobody picomon-watchdog -c $conf > /tmp/picomon-$(basename $conf .py).log 2>&1 & done
for conf in /etc/picomon/*.py; do sudo -u nobody picomon-watchdog -c $conf > /tmp/picomon-$(basename $conf .py).log 2>&1 & done
Description=Picomon Monitoring Daemon for %i
ExecStart=/usr/local/bin/picomon-watchdog -c /etc/picomon/
#ExecReload=/bin/kill -HUP $MAINPID
......@@ -10,5 +10,6 @@ setup(name='Picomon',
packages=['picomon', 'picomon.subprocess_compat'],
scripts=['bin/picomon', 'bin/picomon-watchdog'],
data_files=[('etc/picomon/', [''])],
data_files=[('/etc/picomon/', ['']),
('/etc/systemd/system', ['picomon@.service'])],
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment