Код: Выделить всё
[Unit]
Description=My Target
After=network-online.target
Wants=one-service@%i.service
Wants=two-service@%i.service
BindsTo=one-service@%i.service
BindsTo=two-service@%i.service
[Install]
WantedBy=default.target
Also=one-service@%i.service
Also=two-service@%i.service
Код: Выделить всё
[Unit]
Description=one service
PartOf=my@%i.target
ReloadPropagatedFrom=my@%i.target
Service]
Type=forking
ExecStart=/path/to/my-first-command-${SOME_VAR_DEFINED_IN_ENV_FILE}
PIDFile=/path/to/pidfile
SuccessExitStatus=0
TimeoutStartSec=180s
TimeoutStopSec=180s
RemainAfterExit=true
[Install]
WantedBy=my.target
Я затем выполняю SystemCtl Edit [email protected] ; со следующим: < /p>
Код: Выделить всё
[Service]
User=oneusername
Group=onegroup
EnvironmentFile=/home/%u/etc/%i.environment
Подробнее здесь: https://stackoverflow.com/questions/795 ... -directive