diff --git a/bundles/systemd-timers/files/template.service b/bundles/systemd-timers/files/template.service index ed68677..09c3080 100644 --- a/bundles/systemd-timers/files/template.service +++ b/bundles/systemd-timers/files/template.service @@ -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