[syslog-ng] systemd syslog-ng does not start CentOS 7.2.1511
Scot Needy
scotrn at gmail.com
Tue Apr 12 21:00:01 CEST 2016
Hi,
I need help setting up my control files for systemd I can’t figure out what I am doing wrong. If I make a SystemV start stop script it runs fine.
From systemd I think there is something missing in the control files that lets syslog-ng report that is started successfully.
When I add -F to SYSLOGNG_OPTS then systemctl start syslog-g.service never returns but syslog-ng does start.
Compiled syslog-ng syslog-ng 3.8.0alpha0 no problems.
On the command line syslog-ng will start fine.
/opt/syslog-ng/sbin/syslog-ng -f /opt/syslog-ng/etc/syslog-ng.conf -p /var/run/syslogd.pid
Using contrib/systemd/syslog-ng.service as an example I created /usr/lib/systemd/system/syslog-ng.service
[Unit]
Description=System Logger Daemon
Documentation=man:syslog-ng(8)
[Service]
Type=notify
ExecStart=/opt/syslog-ng/sbin/syslog-ng $SYSLOGNG_OPTS
ExecReload=/bin/kill -HUP $MAINPID
EnvironmentFile=-/opt/syslog-ng/etc/syslog-ng.env
StandardOutput=journal
StandardError=journal
Restart=on-failure
[Install]
WantedBy=multi-user.target
cat /opt/syslog-ng/etc/syslog-ng.env
LD_LIBRARY_PATH=/usr/java/jdk1.8.0_77/jre/lib/amd64/server:$LD_LIBRARY_PATH
SYSLOGNG_OPTS="-f /opt/syslog-ng/etc/syslog-ng.conf -p /var/run/syslogd.pid"
systemctl daemon-reload
systemctl restart systemd-journald
systemctl start syslog-ng.service
systemctl status syslog-ng.service
● syslog-ng.service - System Logger Daemon
Loaded: loaded (/usr/lib/systemd/system/syslog-ng.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2016-04-12 14:51:04 EDT; 29s ago
Docs: man:syslog-ng(8)
Process: 2494 ExecStart=/opt/syslog-ng/sbin/syslog-ng $SYSLOGNG_OPTS (code=exited, status=0/SUCCESS)
Main PID: 2494 (code=exited, status=0/SUCCESS)
Apr 12 14:41:08 loghost systemd[1]: Unit syslog-ng.service entered failed state.
Apr 12 14:41:08 loghost systemd[1]: syslog-ng.service failed.
Apr 12 14:41:08 loghost systemd[1]: syslog-ng.service holdoff time over, scheduling restart.
Apr 12 14:41:08 loghost systemd[1]: Starting System Logger Daemon...
I can see syslog-ng starting and stoping over and over from /var/log/messages
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20160412/d40277f6/attachment.htm
More information about the syslog-ng
mailing list