[syslog-ng] Systemd service times out for syslog-ng 3.16.1
erempel at uvic.ca
Thu May 16 19:57:18 UTC 2019
That seems quite odd to me. We have been running under Redhat 7 for quite some time (hundreds of systems) with a Type=notify
and the -F flag.
● syslog-ng.service - System Logger Daemon
Loaded: loaded (/usr/lib/systemd/system/syslog-ng.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-05-13 14:43:24 PDT; 2 days ago
Main PID: 48953 (syslog-ng)
└─48953 /usr/sbin/syslog-ng -F -p /var/run/syslogd.pid
This uses the service file that is part of the copr RPMs from the syslog-ng maintainers
$ rpm -ql syslog-ng | grep service
Description=System Logger Daemon
ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS -p /var/run/syslogd.pid
ExecReload=/bin/kill -HUP $MAINPID
Oh well. I'm glad you got it running and are happy.
On 5/16/19 12:46 PM, Ronald Fenner wrote:
> Here's the config I came up with that works. The biggest change is that type should be forking. Notify requires the service to signal back to systemd that the process has finished starting up which syslog-ng doesn't do and thus ends up timing out.
> Tje -F flag actually blocked the start command when I ran systemctl start syslog-ng.
> Since syslog-ng apparently forks over to the supervising process the correct type is forking as the service's exec start is expected to exit immediately after execution with the child process running the service.
> Looking at the status for the service show both the supervising and actual process.
> ● syslog-ng.service - System Logger Daemon
> Loaded: loaded (/etc/systemd/system/syslog-ng.service; enabled; vendor preset: enabled)
> Active: active (running) since Thu 2019-05-16 19:26:08 UTC; 14s ago
> Docs: man:syslog-ng(8)
> Process: 12591 ExecStart=/opt/syslog-ng/sbin/syslog-ng $SYSLOGNG_OPTIONS --cfgfile $SYSLOGNG_CONF_FILE --control $SYSLOGNG_CONTROL_FILE --persist-file $SYSLOGNG_PERSIST_FILE --pidfile $SYSLOGNG_PID_FILE (code=exited, status=0/SUCCESS)
> Main PID: 12592 (syslog-ng)
> CGroup: /system.slice/syslog-ng.service
> ├─12592 supervising syslog-ng
> └─12593 /opt/syslog-ng/sbin/syslog-ng --no-caps --cfgfile /opt/syslog-ng/etc/syslog-ng.conf --control /opt/syslog-ng/var//syslog-ng.ctl --persist-file /opt/syslog-ng/var//syslog-ng.persist --pidfile /var/run/...
> May 16 19:26:08 ip-172-30-6-133.ec2.internal systemd: Starting System Logger Daemon...
> May 16 19:26:08 ip-172-30-6-133.ec2.internal systemd: Started System Logger Daemon.
> Description=System Logger Daemon
> Wants=network.target network-online.target
> After=network.target network-online.target
> ExecStart=/opt/syslog-ng/sbin/syslog-ng $SYSLOGNG_OPTIONS --cfgfile $SYSLOGNG_CONF_FILE --control $SYSLOGNG_CONTROL_FILE --persist-file $SYSLOGNG_PERSIST_FILE --pidfile $SYSLOGNG_PID_FILE
> ExecReload=/bin/kill -HUP $MAINPID
> Hope this helps anyone else in the future
> Ronald Fenner
> Network Architect
> Game Circus LLC.
> rfenner at gamecircus.com <mailto:rfenner at gamecircus.com>
>> On May 16, 2019, at 1:07 PM, Ronald Fenner <rfenner at gamecircus.com <mailto:rfenner at gamecircus.com>> wrote:
>> Thanks I'll look through that and see what changes I may need to make.
>> I may have found the problem but I'm still waiting on a build to finish is that my java command was broken when I check to see if I could see some of the Kafka streams to confirm it could access the cluster.
>> I had based mine on the service file listed in GitHub for rhel package and on one that and one I worked up for consul.
>> Ronald Fenner
>> Network Architect
>> Game Circus LLC.
>> rfenner at gamecircus.com <mailto:rfenner at gamecircus.com>
>>> On May 16, 2019, at 11:30 AM, Evan Rempel <erempel at uvic.ca> wrote:
>>> I think you are just missing the forground flag (-F) in the ExecStart command
>>> You can see a discussion of the systemd service unit file at
>>> and a proposed service file.
>>> On 5/16/19 8:27 AM, Ronald Fenner wrote:
>>>> I'm trying to switch from an init.d script to a system service and having problems getting the service to run.
>>>> The syslog-ng service gets timed out and never starts up.
>>>> My service looks like this:
>>>> Description="Syslog-ng an enhanced syslog"
>>>> ExecStart=/opt/syslog-ng/sbin/syslog-ng --no-caps -p /var/run/syslogd.pid -rdvt
>>>> ExecReload=/bin/kill -HUP $MAINPID
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the syslog-ng