Syslog-NG 3.5 fails with systemctl

General support questions
Post Reply
espressobeanie
Posts: 15
Joined: 2016/03/11 02:13:27

Syslog-NG 3.5 fails with systemctl

Post by espressobeanie » 2016/04/11 17:18:11

Hi,

My Syslog-NG service fails every time I run "systemctl restart syslog-ng". I get the following error code:

Code: Select all

Job for syslog-ng.service failed because the control process exited with error code. See "systemctl status syslog-ng.service" and "journalctl -xe" for details.
I get this when I execute "systemctl status syslog-ng.service":

Code: Select all

● syslog-ng.service - System Logger Daemon
   Loaded: loaded (/usr/lib/systemd/system/syslog-ng.service; enabled; vendor preset: enabled)
   Active: failed (Result: start-limit) since Mon 2016-04-11 13:13:02 EDT; 23s ago
     Docs: man:syslog-ng(8)
  Process: 2574 ExecStart=/usr/sbin/syslog-ng -F -p /var/run/syslogd.pid (code=exited, status=1/FAILURE)
 Main PID: 2574 (code=exited, status=1/FAILURE)
   Status: "Starting up... (Mon Apr 11 13:13:02 2016"

Apr 11 13:13:02 localhost.localhost systemd[1]: Failed to start System Logger Daemon.
Apr 11 13:13:02 localhost.localhost systemd[1]: Unit syslog-ng.service entered failed state.
Apr 11 13:13:02 localhost.localhost systemd[1]: syslog-ng.service failed.
Apr 11 13:13:02 localhost.localhost systemd[1]: syslog-ng.service holdoff time over, scheduling restart.
Apr 11 13:13:02 localhost.localhost systemd[1]: start request repeated too quickly for syslog-ng.service
Apr 11 13:13:02 localhost.localhost systemd[1]: Failed to start System Logger Daemon.
Apr 11 13:13:02 localhost.localhost systemd[1]: Unit syslog-ng.service entered failed state.
Apr 11 13:13:02 localhost.localhost systemd[1]: syslog-ng.service failed.
I get this when I run "journalctl -xe":

Code: Select all

-- The result is failed.
Apr 11 13:13:02 localhost.localhost systemd[1]: Unit syslog-ng.service entered failed state.
Apr 11 13:13:02 localhost.localhost systemd[1]: syslog-ng.service failed.
Apr 11 13:13:02 localhost.localhost systemd[1]: syslog-ng.service holdoff time over, scheduling restart.
Apr 11 13:13:02 localhost.localhost systemd[1]: start request repeated too quickly for syslog-ng.service
Apr 11 13:13:02 localhost.localhost systemd[1]: Failed to start System Logger Daemon.
-- Subject: Unit syslog-ng.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit syslog-ng.service has failed.

Any ideas?

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Syslog-NG 3.5 fails with systemctl

Post by aks » 2016/04/12 16:12:51

Hmm, not much to go on.
Does systemctl -l status syslog-ng give any clues? Also do a stop and then do a start (as opposed to restart).

Also (and I think this is not applicable to the version of syslog-ng you're using but it doesn't hurt to check), apparently you need to define the log as unix-dgram (datagram) not stream for systemd: see https://fedoraproject.org/wiki/Common_F ... g-problems

Otherwise, no clue, guess we need more information.

jaearick
Posts: 2
Joined: 2016/09/07 16:21:53

Re: Syslog-NG 3.5 fails with systemctl

Post by jaearick » 2016/09/07 16:31:11

I ran into the same issue with syslog-ng 3.5.6 on Centos 7.2. My problem was a customized syslog-ng.conf that had errors. When I ran syslog-ng in the foreground by hand, it smoked out my typos, eg:

# /usr/sbin/syslog-ng -F -p /var/run/syslogd.pid
Error parsing config, syntax error, unexpected '{', expecting '}' in /etc/syslog-ng/syslog-ng.conf at line 59, column 22:

source s_syslog_udp {{
^

FWIW, I find it strange that systemctl invocation (ie, the contents of /usr/lib/systemd/system/syslog-ng.service) uses the '-F" flag, saying to run syslog-ng as a foreground process, even though it ends up as a daemon. This seems like a really twisted setup...

root 9729 1 0 12:17 ? 00:00:00 /usr/sbin/syslog-ng -F -p /var/run/syslogd.pid

jaearick
Posts: 2
Joined: 2016/09/07 16:21:53

Re: Syslog-NG 3.5 fails with systemctl

Post by jaearick » 2016/09/08 18:25:50

The systemctl service file for syslog-ng seems half-baked in Centos 7.2. There is no way to stop syslog-ng via systemctl because there is no entry for ExecStop there, and the restart setting is "on-failure". I get that ordinarily you don't ever want syslog-ng down, but sometimes you need to shut it down and have it stay out of the way for a bit.

With Centos 7.2, if I hit syslog-ng with a clean signal (as defined in the manpage for systemd.service under SuccessExitStatus=, I used "9") the process dies and then immediately restarts. I added the following lines to /etc/systemd/system/syslog.server:

ExecStop=/bin/kill -KILL $MAINPID
RestartSec=10

then did "systemctl daemon-reload" and some more testing. This setup at least gives me a 10 second window of no syslog, but the ExecStop and/or watchdog will still not leave the daemon down even with a clean signal. Something doesn't seem right in the systemctl configuration.

fwiffo
Posts: 5
Joined: 2016/03/30 19:38:25

Re: Syslog-NG 3.5 fails with systemctl

Post by fwiffo » 2017/02/24 07:03:38

my syslog-ng failed on startup because it doesnt play nice with rsyslog (im thinking they both use port 514)

systemctl disable rsyslog

allowed me to systemctl start syslog-ng

syslog-ng-3.5.6-3.el7.x86_64

Post Reply