[syslog-ng] issues with starting syslog-ng from systemd
Ronald Fenner
rfenner at gamecircus.com
Fri Nov 20 16:15:38 UTC 2020
Just for comparison this is the service file I use for syslog-ng
[Unit]
Description=System Logger Daemon
Documentation=man:syslog-ng(8)
After=network.target network-online.target consul.service
[Service]
Type=forking
Environment=SYSLOGNG_PID_FILE="/var/run/syslog-ng.pid"
Environment=SYSLOGNG_CONF_FILE="/opt/syslog-ng/etc/syslog-ng.conf"
Environment=SYSLOGNG_PERSIST_FILE="/opt/syslog-ng/disk-buffers/syslog-ng.persist"
Environment=SYSLOGNG_CONTROL_FILE="/opt/syslog-ng/var/syslog-ng.ctl"
Environment=SYSLOGNG_OPTIONS="--no-caps"
Environment=LD_LIBRARY_PATH=/usr/lib/jvm/jre/lib/amd64/server:/usr/local/lib:$LD_LIBRARY_PATH
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
StandardOutput=journal
StandardError=journal
Restart=always
[Install]
WantedBy=multi-user.target
Al
If you make Type=Forking that should help since it signals to system that the process will fork then exit.
Ronald Fenner
Network Architect
Game Circus LLC.
rfenner at gamecircus.com
> On Nov 19, 2020, at 2:47 PM, Laszlo Szemere (lszemere) <Laszlo.Szemere at oneidentity.com> wrote:
>
> Hello Russel,
>
> by default, Syslog-ng spawns a supervising process and exists, which is detected by Systemd as a starting failure. Try adding the -F option to your ExecStart command.
>
> If it not helps: as you stated correctly, most of the Systemd problems are permission or environment problems. Try adding -devt to the ExecStart command to get a more verbose output from Syslog-ng.
>
>
> Best regards,
> Laci
> From: syslog-ng <syslog-ng-bounces at lists.balabit.hu <mailto:syslog-ng-bounces at lists.balabit.hu>> on behalf of Russell Fulton <r.fulton at auckland.ac.nz <mailto:r.fulton at auckland.ac.nz>>
> Sent: Thursday, November 19, 2020 21:19
> To: syslog-ng at lists.balabit.hu <mailto:syslog-ng at lists.balabit.hu> <syslog-ng at lists.balabit.hu <mailto:syslog-ng at lists.balabit.hu>>
> Subject: [syslog-ng] issues with starting syslog-ng from systemd
>
> CAUTION: This email originated from outside of the organization. Do not follow guidance, click links, or open attachments unless you recognize the sender and know the content is safe.
>
>
> version 3.26.1 — ubuntu 14.04
>
> I can start syslog-ng from the command line without issues (apart form a warning to stderr) but when I try and start it from systemd it starts up (it prints the warning message to the logs) and then exits silently.
>
> This version was compiled locally i.e. it was not installed from a package. The .service file was adapted from a sample in the contrib directory. I also had the same behaviour from and other .service file that I put together myself.
>
> It is presumably some to do with the environment.
>
> I did try starting it with -i (interactive) in the hope that it would spit something out on the console but instead it hung and I had to ^C it
>
> Any thoughts on how to figure out what is going on?
>
> =====================================
>
> here are two different attempts (first commented)
>
> rful011 at secmgrprd02:~$ cat /etc/systemd/system/syslog-ng.service
> #[Unit]
> #Description=syslog next generation
> #After=network.target auditd.service
>
> #[Service]
> #EnvironmentFile=/etc/default/syslog-ng
> #ExecStart=/usr/local/sbin/syslog-ng -f /usr/local/etc/syslog-ng.conf
> #ExecReload=/usr/local/sbin/syslog-ng-ctl reload
> #Restart=on-failure
> #RestartPreventExitStatus=255
> #Type=notify
>
> #[Install]
> #WantedBy=multi-user.target
> #Alias=syslog-ng.service
>
>
> [Unit]
> Description=System Logger Daemon
> Documentation=man:syslog-ng(8)
> Conflicts=emergency.service emergency.target
> Wants=network.target network-online.target
> After=network.target network-online.target
>
> [Service]
> Type=notify
> EnvironmentFile=-/etc/default/syslog-ng
> EnvironmentFile=-/etc/sysconfig/syslog-ng
> ExecStart=/usr/local/sbin/syslog-ng -f /usr/local/etc/syslog-ng.conf
> ExecReload=/usr/local/sbin/syslog-ng-ctl reload
> StandardOutput=journal
> StandardError=journal
> Restart=on-failure
>
> [Install]
> WantedBy=multi-user.target
>
> ______________________________________________________________________________
> Member info: https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.balabit.hu%2Fmailman%2Flistinfo%2Fsyslog-ng&data=04%7C01%7CLaszlo.Szemere%40oneidentity.com%7Ca91b88c842bd4a8a2d0608d88cc865bb%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637414139633183249%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=dr1znNjgKtRp8R3YsDn1MfSTqCSx9Y%2FKp2XRtkIl5w0%3D&reserved=0 <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.balabit.hu%2Fmailman%2Flistinfo%2Fsyslog-ng&data=04%7C01%7CLaszlo.Szemere%40oneidentity.com%7Ca91b88c842bd4a8a2d0608d88cc865bb%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637414139633183249%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=dr1znNjgKtRp8R3YsDn1MfSTqCSx9Y%2FKp2XRtkIl5w0%3D&reserved=0>
> Documentation: https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fsupport%2Fdocumentation%2F%3Fproduct%3Dsyslog-ng&data=04%7C01%7CLaszlo.Szemere%40oneidentity.com%7Ca91b88c842bd4a8a2d0608d88cc865bb%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637414139633183249%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1aHuGKne5J%2FyTdvf7j2cpkZkKKbDkO%2B%2F2QoyTXXa1Sg%3D&reserved=0 <https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fsupport%2Fdocumentation%2F%3Fproduct%3Dsyslog-ng&data=04%7C01%7CLaszlo.Szemere%40oneidentity.com%7Ca91b88c842bd4a8a2d0608d88cc865bb%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637414139633183249%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1aHuGKne5J%2FyTdvf7j2cpkZkKKbDkO%2B%2F2QoyTXXa1Sg%3D&reserved=0>
> FAQ: https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fwiki%2Fsyslog-ng-faq&data=04%7C01%7CLaszlo.Szemere%40oneidentity.com%7Ca91b88c842bd4a8a2d0608d88cc865bb%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637414139633183249%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=aDkLqXsHant5U2dUB5u4IkISQ1u0BaDdG4ItXBZBk2U%3D&reserved=0 <https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fwiki%2Fsyslog-ng-faq&data=04%7C01%7CLaszlo.Szemere%40oneidentity.com%7Ca91b88c842bd4a8a2d0608d88cc865bb%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637414139633183249%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=aDkLqXsHant5U2dUB5u4IkISQ1u0BaDdG4ItXBZBk2U%3D&reserved=0>
>
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng <https://lists.balabit.hu/mailman/listinfo/syslog-ng>
> Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng <http://www.balabit.com/support/documentation/?product=syslog-ng>
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq <http://www.balabit.com/wiki/syslog-ng-faq>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.balabit.hu/pipermail/syslog-ng/attachments/20201120/6a1649fe/attachment-0001.html>
More information about the syslog-ng
mailing list