bundles/systemd-timers: better exclude_from_monitoring support
This commit is contained in:
parent
33ae4796d4
commit
f8b833720a
1 changed files with 8 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
<%
|
||||||
|
if config.get('exclude_from_monitoring', False):
|
||||||
|
monitored = ''
|
||||||
|
else:
|
||||||
|
monitored = f'/usr/local/sbin/systemd-timer-monitored {timer} '
|
||||||
|
%>\
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Service for Timer ${timer}
|
Description=Service for Timer ${timer}
|
||||||
After=network.target
|
After=network.target
|
||||||
|
@ -15,10 +21,8 @@ WorkingDirectory=${config.get('pwd', '/')}
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
% if isinstance(config['command'], list):
|
% if isinstance(config['command'], list):
|
||||||
% for command in config['command']:
|
% for command in config['command']:
|
||||||
ExecStart=/usr/local/sbin/systemd-timer-monitored ${timer} ${command}
|
ExecStart=${monitored}${command}
|
||||||
% endfor
|
% endfor
|
||||||
% elif config.get('exclude_from_monitoring', False):
|
|
||||||
ExecStart=${config['command']}
|
|
||||||
% else:
|
% else:
|
||||||
ExecStart=/usr/local/sbin/systemd-timer-monitored ${timer} ${config['command']}
|
ExecStart=${monitored}${config['command']}
|
||||||
% endif
|
% endif
|
||||||
|
|
Loading…
Reference in a new issue