24 lines
443 B
Bash
24 lines
443 B
Bash
# -*- mode: Shell-script -*-
|
|
# name:systemd
|
|
# key:systemd
|
|
# --
|
|
[Unit]
|
|
Description=Description goes here
|
|
Wants=network.target
|
|
|
|
[Service]
|
|
Environment="VAR_NAME=value"
|
|
EnvironmentFile=-/etc/environment
|
|
ExecStart=/usr/bin/bash /home/myuser/myscript.sh${1}
|
|
SyslogIdentifier=my.service
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
# Should exist!
|
|
WorkingDirectory=/var/my.service${2}
|
|
TimeoutStopSec=30
|
|
Type=simple
|
|
User=root
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|