The Gluster Blog

Gluster blog stories provide high-level spotlights on our users all over the world

Correcting broken startup of rsyslogd in a systemd unit file

Gluster
2012-03-05

My Fedora 17 Beefy Miracle alpha1 ARM system does not any contents in /var/log/messages. This is very impractical for troubleshooting. The command systemd-journalctl --no-tail shows that rsyslog.service fails to start correctly. Bummer!

Starting the daemon by hand, does not give any issues, so at least rsyslogd does not have an issue itself.

Checking the configuration, there are two unit files that may be used to start rsyslogd:

  1. /etc/systemd/system/syslog.service
  2. /etc/systemd/system/multi-user.target.wants/rsyslog.service

Both of these are symlinks to the unit file (/usr/lib/systemd/system/rsyslog.service) that comes with the rsyslogd package:

[Unit]
Description=System Logging Service

[Service]
EnvironmentFile=-/etc/sysconfig/rsyslog
ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service
ExecStart=/sbin/rsyslogd -n $SYSLOGD_OPTIONS
Sockets=syslog.socket
StandardOutput=null

[Install]
WantedBy=multi-user.target

All looks pretty neat, there is no very obvious issue here. However, on checking what this systemd-kmsg-syslogd.service is and does, I seem to be unable to find the unit file that defines this service. Just guessing, but if the ExecStartPre fails, it may not even try to start the rsyslog-daemon. Just commenting out the ExecStartPre is Not Done with the systemd configuration files. The advised way to change unit files which live under /usr/lib/systemd should be copied to the /etc/systemd/* directories instead:

# cd /etc/systemd/system
# rm syslog.service
# ln -s /usr/lib/systemd/system/rsyslog.service syslog.service
# cd multi-user.target.wants
# rm rsyslog.service
# ln -s ../syslog.service rsyslog.service

Now is is possible to change the unit file, without changing a file that may be replaced by a update of the rsyslog package. Commenting out the ExecStartPre in the new copy of syslog.service and rebooting, makes syslog work for me and /var/log/messages contains all the logs as expected.

More brokenness in my systemd configuration

One more annoying thing is that systemctl is not very usable:

# systemctl status rsyslog.service
Failed to get D-Bus connection: No connection to service manager.

Although D-Bus is running:

# ps v -C dbus-daemon
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
1474 ? Ss 0:00 6 265 2770 1436 0.3 /bin/dbus-daemon --system --address=systemd: --nofork --systemd-activation

I’m not sure what causes that (SElinux is disabled), but it is currently no big issue for me.

BLOG

  • 06 Dec 2020
    Looking back at 2020 – with g...

    2020 has not been a year we would have been able to predict. With a worldwide pandemic and lives thrown out of gear, as we head into 2021, we are thankful that our community and project continued to receive new developers, users and make small gains. For that and a...

    Read more
  • 27 Apr 2020
    Update from the team

    It has been a while since we provided an update to the Gluster community. Across the world various nations, states and localities have put together sets of guidelines around shelter-in-place and quarantine. We request our community members to stay safe, to care for their loved ones, to continue to be...

    Read more
  • 03 Feb 2020
    Building a longer term focus for Gl...

    The initial rounds of conversation around the planning of content for release 8 has helped the project identify one key thing – the need to stagger out features and enhancements over multiple releases. Thus, while release 8 is unlikely to be feature heavy as previous releases, it will be the...

    Read more