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]
|
||||
Description=Service for Timer ${timer}
|
||||
After=network.target
|
||||
|
@ -15,10 +21,8 @@ WorkingDirectory=${config.get('pwd', '/')}
|
|||
Type=oneshot
|
||||
% if isinstance(config['command'], list):
|
||||
% for command in config['command']:
|
||||
ExecStart=/usr/local/sbin/systemd-timer-monitored ${timer} ${command}
|
||||
ExecStart=${monitored}${command}
|
||||
% endfor
|
||||
% elif config.get('exclude_from_monitoring', False):
|
||||
ExecStart=${config['command']}
|
||||
% else:
|
||||
ExecStart=/usr/local/sbin/systemd-timer-monitored ${timer} ${config['command']}
|
||||
ExecStart=${monitored}${config['command']}
|
||||
% endif
|
||||
|
|
Loading…
Reference in a new issue