1

Periodically, I see the following in syslog:

systemd[1]: spamassassin.service: Main process exited, code=exited, status=255/n/a
systemd[1]: spamassassin.service: Unit entered failed state.
systemd[1]: spamassassin.service: Failed with result 'exit-code'.

but the service does not automatically restart. It does start successfully with:

sudo service spamassassin restart

Can I configure spamassassin to restart automatically after it fails?

flymike
  • 307

1 Answers1

1

The manpage for systemd.service has the answer. For my particular case, the simplest solution was to add:

Restart=always
RestartSec=3

to the [Service] section of /lib/systemd/system/spamassassin.service

But there are more sophisticated controls available to limit restarts, should a failure loop occur.

flymike
  • 307