Bug 799331 - systemd doesn't automatically restart rsyslog
systemd doesn't automatically restart rsyslog
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: rsyslog (Show other bugs)
22
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tomas Heinrich
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-02 09:06 EST by Andreas Fleig
Modified: 2016-09-20 00:50 EDT (History)
9 users (show)

See Also:
Fixed In Version: rsyslog-8.8.0-2.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1061322 (view as bug list)
Environment:
Last Closed: 2015-04-11 10:12:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andreas Fleig 2012-03-02 09:06:29 EST
Description of problem:

Systemd does not automatically restart rsyslog if it exits, e.g. after restoring a crashed system with a sysrq key combination. Syslog is a critical service, and should therefore be restarted.


How reproducible:
Always


Steps to Reproduce:
1. kill $rsyslog_pid
2. systemctl status rsyslog.service

  
Actual results:
Syslog is and stays dead.


Expected results:
Systemd restarts syslog.


Additional info:
Fix by adding "Restart=always" to the "Service" section in /lib/systemd/system/rsyslog.service
Comment 1 Jóhann B. Guðmundsson 2012-03-02 09:25:44 EST
Service should not be restarted automatically by default. 

By the way where did you get the bright idea from that this was a smart thing to do?
Comment 2 Jóhann B. Guðmundsson 2012-03-02 09:30:06 EST
Anyway moving this against rsyslog in the end he's the one you have to convince that this is an great idea...
Comment 3 Michal Schmidt 2012-03-02 10:04:54 EST
(In reply to comment #0)
> Syslog is a critical service, and should therefore be restarted.

It is not critical everywhere. It depends on the use case. It's a policy
decision. We provide the mechanism.

> Additional info:
> Fix by adding "Restart=always" to the "Service" section in
> /lib/systemd/system/rsyslog.service

Feel free to adjust the restart policy for any service you want on your system
(just do it by putting modified unit files under /etc/systemd/system,
http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F).

I do not think it would be a good idea to ship auto-restarting services by default.
Comment 4 Andreas Fleig 2012-03-02 12:00:05 EST
Well, it's just what I expected to happen, since I noticed that gdm and mysqld are restarted automatically. I won't take offense if you close this issue as NOTABUG...
Comment 5 Jóhann B. Guðmundsson 2012-03-02 12:11:23 EST
gdm is exeption to the general rule but mysql hmm must be because mysqld_safe did that. 

In any case administrators should put and arguably this is better default restart behaviour than default to none is to set Restart=on-failure
Comment 6 Florian Weimer 2012-08-23 07:18:12 EDT
If the syslog daemon is gone, we lose a lot of system logging.  This makes post-mortem analysis really difficult, so I'd prefer if it was restarted automatically.
Comment 7 Fedora End Of Life 2013-01-16 15:04:38 EST
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 8 Florian Weimer 2013-01-17 01:24:56 EST
Still present in rsyslog-7.2.4-1.fc18.x86_64.
Comment 9 Jóhann B. Guðmundsson 2013-01-17 01:36:02 EST
If you want to restart rsyslog automatically you do so by following http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F

And add Restart=on-failure or Restart=Always to the resyslogd unit file

This is not a systemd bug thus closing
Comment 10 Florian Weimer 2013-01-17 01:42:33 EST
(In reply to comment #9)
> This is not a systemd bug thus closing

This was filed against rsylog, so reopening.
Comment 11 Jóhann B. Guðmundsson 2013-01-17 01:47:05 EST
Regardless of that it's not a bug. You just manually add this to your unit if you feel it necessary the rest of us can live with recovering logs from systemd journal.
Comment 12 Fedora End Of Life 2013-12-21 03:33:49 EST
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 13 Tomas Heinrich 2013-12-22 08:14:23 EST
Given that journald is the default now and this change can have adverse effects, I'd rather not turn auto-restarting on by default.
Comment 14 Tomas Heinrich 2015-01-19 04:44:07 EST
Revisiting this issue.

Upstream changed the behavior to Restart=on-failure, journald has Restart=always.
Given that systemd is capable of limiting the number of restarts in case of a permanent failure, it might not be such a bad idea to enable this by default.

(In reply to Michal Schmidt from comment #3)
> (In reply to comment #0)
> > Syslog is a critical service, and should therefore be restarted.
> 
> It is not critical everywhere. It depends on the use case. It's a policy
> decision. We provide the mechanism.

We still need some default policy.

I'll probably make the change in f22 with the next update if there are no hard objections.
Comment 15 Jóhann B. Guðmundsson 2015-01-19 12:14:32 EST
As far as I know Syslog-ng reads directly from a journal files now by default so no log files are configured and I do believe the recent version of rsyslog does that as well so Restart=on-failure seems like the reasonable default for rsyslog and syslog-ng in the distribution while journald has Restart=always

Note You need to log in before you can comment on or make changes to this bug.