I've been trying out the Restart= option in some of my own systemd service unit files - which appears to work fine However, I notice that this option is only used in a few OS provided service unit files - and was wondering about the wisdom of adding this capability to other daemons/services? (e.g. chronyd or ntpd, crond, rpcbind, etc, etc) - not that these daemons are likely to crash and need restarting that often ... Previously, I've used custom scripts to monitor the state of key daemons and restart or report their status as appropriate - but as systemd has 'Restart' and 'OnFailure' capabilities build in, these options could potentially make (my) life a bit easier ... Are there any potential pit-falls in using Restart with OS provided daemons/services? Thanks James Pearson
Although not on CentOS, I've been forced to use it with serial-getty at .service (even after enabling and starting it) to get the OS to display a console prompt after an OS upgrade. In this case I used Restart=on-success and RestartSec=5 (the latter an arbitrary value) because agetty exited after the first console disconnect. ----- Original Message ----- From: "James Pearson" <james-p at moving-picture.com> To: "centos" <centos at centos.org> Sent: Wednesday, June 28, 2017 7:54:43 AM Subject: [CentOS] systemd services and Restart? I've been trying out the Restart= option in some of my own systemd service unit files - which appears to work fine However, I notice that this option is only used in a few OS provided service unit files - and was wondering about the wisdom of adding this capability to other daemons/services? (e.g. chronyd or ntpd, crond, rpcbind, etc, etc) - not that these daemons are likely to crash and need restarting that often ... Previously, I've used custom scripts to monitor the state of key daemons and restart or report their status as appropriate - but as systemd has 'Restart' and 'OnFailure' capabilities build in, these options could potentially make (my) life a bit easier ... Are there any potential pit-falls in using Restart with OS provided daemons/services? Thanks James Pearson _______________________________________________ CentOS mailing list CentOS at centos.org https://lists.centos.org/mailman/listinfo/centos
On Wed, Jun 28, 2017 at 12:54:43PM +0000, James Pearson wrote:> However, I notice that this option is only used in a few OS provided > service unit files - and was wondering about the wisdom of adding this > capability to other daemons/services? (e.g. chronyd or ntpd, crond, > rpcbind, etc, etc) - not that these daemons are likely to crash and need > restarting that often ...I think it's a good idea. We just haven't had a push (either at Red Hat internally or Fedora upstream) to go through and enable this everywhere it makes sense. The guidelines do recommend it: https://fedoraproject.org/wiki/Packaging:Systemd#Automatic_restarting> Are there any potential pit-falls in using Restart with OS provided > daemons/services?See the caveat on Restart=on-abnormal in the doc above. -- Matthew Miller <mattdm at fedoraproject.org> Fedora Project Leader
Matthew Miller wrote:> > I think it's a good idea. We just haven't had a push (either at > Red Hat internally or Fedora upstream) to go through and enable this > everywhere it makes sense. The guidelines do recommend it: > > https://fedoraproject.org/wiki/Packaging:Systemd#Automatic_restarting > >> Are there any potential pit-falls in using Restart with OS provided >> daemons/services? > > See the caveat on Restart=on-abnormal in the doc above.OK - thanks. Glad to see that my musings agree with the guidelines :-) James Pearson