Код: Выделить всё
[Unit]
Description=My Service
After=network.target nginx.service mysql.service
OnFailure=notify.service
StartLimitIntervalSec=350s
StartLimitBurst=20
[Service]
ExecStart=/usr/bin/php /path/to/my/script
ExecStartPost=/usr/bin/bash /path/to/anotherscript //that executes while starting service
Restart=on-failure
RestartSec=15s
User=vagrant
[Install]
WantedBy=multi-user.target
Подробнее здесь: https://stackoverflow.com/questions/785 ... -is-failed
Мобильная версия