bundlewrap/bundles/systemd-timers/files/template.service

29 lines
736 B
Desktop File

<%
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
% if config.get('requires', ''):
Requires=${config['requires']}
% endif
[Service]
User=${config.get('user', 'root')}
Group=${config.get('group', config.get('user', 'root'))}
% for k, v in sorted(config.get('environment', {}).items()):
Environment=${k}=${v}
% endfor
WorkingDirectory=${config.get('pwd', '/')}
Type=oneshot
% if isinstance(config['command'], list):
% for command in config['command']:
ExecStart=${monitored}${command}
% endfor
% else:
ExecStart=${monitored}${config['command']}
% endif