Bug 681127 - systemd: sysv services should log errors to syslog
Summary: systemd: sysv services should log errors to syslog
Status: VERIFIED FIXED
Alias: None
Product: openSUSE 12.1
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Factory
Hardware: All Linux
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Frederic Crozat
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-20 22:47 UTC by Jan Engelhardt
Modified: 2012-03-11 23:46 UTC (History)
2 users (show)

See Also:
Found By: Beta-Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Engelhardt 2011-03-20 22:47:15 UTC
# rcdhcpd start
# ps xaf | grep dhcp
13430 pts/3    S+     0:00              \_ grep --color=auto dhcp

So /etc/init.d/dhcpd did not start anything. Let's see:

# systemctl status dhcpd.service
dhcpd.service - LSB: ISC DHCP 4.x Server
          Loaded: loaded (/etc/init.d/dhcpd)
          Active: active (exited) since Sun, 20 Mar 2011 23:41:20 +0100; 3min 7s ago
         Process: 13116 ExecStart=/etc/init.d/dhcpd start (code=exited, status=6/NOTCONFIGURED)
          CGroup: name=systemd:/system/dhcpd.service

But there is no mention in /var/log/messages or otherwise as to what actually went wrong.

I changed /etc/rc.status temporarily:

-if /bin/mountpoint -q /sys/fs/cgroup/systemd > /dev/null 2>&1 ; then
+if false && /bin/mountpoint -q /sys/fs/cgroup/systemd > /dev/null 2>&1 ; then

And then retried rcdhcpd, and it finally gave me the proper message:

# rcdhcpd start
Starting ISC DHCPv4 4.x Server ... set DHCPD_INTERFACE in /etc/sysconfig/dhcpd     skipped

A totally normal issue of humans missing out on config options, but it is real unfortunate nobody is going to see this much needed message with systemctl ATM.
Comment 1 Ruediger Oertel 2011-03-21 09:19:05 UTC
Werner, Kay: what should systemd be doing here ?
Comment 2 Dr. Werner Fink 2011-03-21 10:04:14 UTC
IMHO the messages as well as the exit status should be visible to the
executor.  The last line done by /etc/rc.status is

     exec /bin/systemctl $1 "${_rc_base}.service"

with _rc_base being the script.  Also if a script reports at start or stop
an other exit status as for success an error should be mentioned in the
logs (IMHO).
Comment 3 Kay Sievers 2011-03-21 12:38:54 UTC
It's a know current issue with sysv services. The error should show up in syslog, but we need to make sure that syslog itself will not get into a loop on error. It's currently being worked on upstream.

The fix for now is to provide native service files, where all this can be configured fine-grained.

Also syslog needs to be adopted to not use any sysv init script to be sure we don't create loops.
Comment 4 Frederic Crozat 2011-12-20 15:56:53 UTC
marking as duplicate

*** This bug has been marked as a duplicate of bug 732353 ***
Comment 5 Jan Engelhardt 2012-01-06 04:22:52 UTC
I can't say I am satisfied yet.


For comparison, rcnetwork behaves as expected, that is, the output goes to tty in any case:

silver:~ # /etc/init.d/network stop
redirecting to systemctl
Shutting down network interfaces:
    eth0      device: Broadcom Corporation NetXtreme BCM5704 Gigabi  done
    eth1      device: Broadcom Corporation NetXtreme BCM5704 Gigabi
              No configuration found for eth1 
              Nevertheless the interface will be shut down.          done
Shutting down service network  .  .  .  .  .  .  .  .  .             done


Perfect that. Just dhcpd is not on the same track, although both are LSB scripts with active-exited semantics:


05:12 nakamura:/etc/sysconfig # rcdhcpd start
redirecting to systemctl
05:12 nakamura:/etc/sysconfig # systemctl status dhcpd.service
dhcpd.service - LSB: ISC DHCP 4.x Server
          Loaded: loaded (/etc/init.d/dhcpd)
          Active: active (exited) since Fri, 06 Jan 2012 05:12:57 +0100; 4s ago
         Process: 2808 ExecStart=/etc/init.d/dhcpd start (code=exited, status=6/NOTCONFIGURED)
          CGroup: name=systemd:/system/dhcpd.service


This is systemd-37 with your Dec 07 updates (--changelog) applied.
Comment 6 Frederic Crozat 2012-01-06 09:57:38 UTC
this is no way systemd will be change to output something different for each initscript (but feel free to ask upstream systemd to try to convince them).

The only addition which will happen in the future is the relevant log for each service, when using systemctl status, thanks to systemd journal.
Comment 7 Jan Engelhardt 2012-01-06 10:04:06 UTC
What, there is a special case for rcnetwork?
Comment 8 Frederic Crozat 2012-01-06 10:21:17 UTC
no special case for rcnetwork : it doesn't output anything more than systemctl status, when you run : rcnetwork status.
Comment 9 Cristian Rodríguez 2012-01-07 03:53:34 UTC
(In reply to comment #6)
> The only addition which will happen in the future is the relevant log for each
> service, when using systemctl status, thanks to systemd journal.

Which is now implemented .
Comment 10 Frederic Crozat 2012-02-06 12:15:41 UTC
I've pushed a fix from upstream in package in home:fcrozat:systemd/systemd which ensure sysv services output is pushed to syslog in addition to console.

Closing as fixed.
Comment 11 Bernhard Wiedemann 2012-02-20 13:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (681127) was mentioned in
https://build.opensuse.org/request/show/106032 12.1 / systemd