Bug 799331

Summary: systemd doesn't automatically restart rsyslog
Product: [Fedora] Fedora Reporter: Andreas Fleig <andreasfleig>
Component: rsyslogAssignee: Tomas Heinrich <theinric>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: fweimer, johannbg, metherid, mschmidt, notting, plautrba, pvrabec, systemd-maint, theinric
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 14:12:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andreas Fleig 2012-03-02 14:06:29 UTC
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 14:25:44 UTC
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 14:30:06 UTC
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 15:04:54 UTC
(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 17:00:05 UTC
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 17:11:23 UTC
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 11:18:12 UTC
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 20:04:38 UTC
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 06:24:56 UTC
Still present in rsyslog-7.2.4-1.fc18.x86_64.

Comment 9 Jóhann B. Guðmundsson 2013-01-17 06:36:02 UTC
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 06:42:33 UTC
(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 06:47:05 UTC
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 08:33:49 UTC
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 13:14:23 UTC
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 09:44:07 UTC
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 17:14:32 UTC
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