2022-02-06 12:39:52 +00:00
|
|
|
[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', '/')}
|
2022-02-07 06:01:19 +00:00
|
|
|
Type=oneshot
|
|
|
|
% if isinstance(config['command'], list):
|
|
|
|
% for command in config['command']:
|
|
|
|
ExecStart=/usr/local/sbin/systemd-timer-monitored ${timer} ${command}
|
|
|
|
% endfor
|
|
|
|
% else:
|
2022-02-06 12:39:52 +00:00
|
|
|
ExecStart=/usr/local/sbin/systemd-timer-monitored ${timer} ${config['command']}
|
2022-02-07 06:01:19 +00:00
|
|
|
% endif
|