bundles/systemd-timers: better exclude_from_monitoring support

This commit is contained in:
Franzi 2024-04-09 06:06:02 +02:00
parent 33ae4796d4
commit f8b833720a
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -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