Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I always set `RestartSec`.


That, plus restricting the number of restarts within an interval, is good.

You can then also set "OnFailure" to trigger another unit if the failure state is reached, e.g. to trigger a notification.

E.g.:

    [Unit]
    ...
    OnFailure=notify-failure@%n.service

    [Service]
    Type=simple
    Restart=on-failure
    RestartSec=5
    ..
    StartLimitBurst=5
    StartLimitIntervalSec=300




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: