[syslog-ng] Systemd service times out for syslog-ng 3.16.1
rfenner at gamecircus.com
Thu May 16 19:46:28 UTC 2019
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
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)
├─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
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
Game Circus LLC.
rfenner at gamecircus.com
> On May 16, 2019, at 1:07 PM, Ronald Fenner <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
>> 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
>> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
>> Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
>> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the syslog-ng