<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="margin: 0px; font-size: 12pt; font-family: Arial, Helvetica, sans-serif">
Hello Alex,</div>
<div style="margin: 0px; font-size: 12pt; font-family: Arial, Helvetica, sans-serif">
<br>
</div>
<div style="margin: 0px; font-size: 12pt; font-family: Arial, Helvetica, sans-serif">
 an another solution would be to make systemd aware that your service takes longer time to start up. (Which can lead to other problems beside syslog-ng startup.)</div>
<div style="margin: 0px; font-size: 12pt; font-family: Arial, Helvetica, sans-serif">
 Please refer to systemd.service "Type" parameter: <a href="https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=">https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=</a> , maybe your service supports it. This way
 systemd will automatically resolves the synchronization between your services.</div>
<div style="margin: 0px; font-size: 12pt; font-family: Arial, Helvetica, sans-serif">
<br>
</div>
<div style="margin: 0px; font-size: 12pt; font-family: Arial, Helvetica, sans-serif">
Best regards,</div>
<div style="margin: 0px; font-size: 12pt; font-family: Arial, Helvetica, sans-serif">
Laci</div>
<div style="margin: 0px; font-size: 12pt; font-family: Arial, Helvetica, sans-serif">
<br>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> syslog-ng <syslog-ng-bounces@lists.balabit.hu> on behalf of Balazs Scheidler <bazsi77@gmail.com><br>
<b>Sent:</b> Tuesday, July 21, 2020 13:22<br>
<b>To:</b> Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu><br>
<b>Subject:</b> Re: [syslog-ng] syslog-ng restarts due to interface not ready</font>
<div> </div>
</div>
<div>
<div style="background-color:#FFEB9C; width:100%; border-style:solid; border-color:#9C6500; border-width:1pt; padding:2pt; font-size:10pt; line-height:12pt; font-family:'Calibri'; color:Black; text-align:left">
<span style="color:#9C6500; font-weight:bold">CAUTION:</span> 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.</div>
<br>
<div>
<div dir="ltr">
<div>This sysctl may of help (in /proc/sys/net/ipv4)<br>
</div>
<div><br>
</div>
<div>       ip_nonlocal_bind (Boolean; default: disabled; since Linux 2.4)<br>
              If set, allows processes to bind(2) to nonlocal IP addresses,  which  can  be<br>
              quite useful, but may break some applications.</div>
<div><br>
</div>
<div>A syslog-ng specific option would be to allow setting IP_FREEBIND on listener sockets, which would be a handy feature.</div>
<div><br>
</div>
<div>       IP_FREEBIND (since Linux 2.4)<br>
              If enabled, this boolean option allows binding to an IP address that is  non‐<br>
              local  or  does not (yet) exist.  This permits listening on a socket, without<br>
              requiring the underlying  network  interface  or  the  specified  dynamic  IP<br>
              address  to  be  up at the time that the application is trying to bind to it.<br>
              This option is the per-socket equivalent of the ip_nonlocal_bind /proc inter‐<br>
              face described below.<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, Jul 21, 2020 at 12:18 PM Alexandre Santos <<a href="mailto:alexandre.rosas.santos@gmail.com">alexandre.rosas.santos@gmail.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div>Thank you for your answer,</div>
<div><br>
</div>
<div>Unfortunately, this did not solve the problem, because the interface is being created by an application on startup.</div>
<div><br>
</div>
<div>Do you know any way to check if the interface exists before trying to connect using syslog-ng configurations?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Alex<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Fri, Jun 26, 2020 at 10:52 AM Nagy Gábor <<a href="mailto:gabor.hl@gmail.com" target="_blank">gabor.hl@gmail.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div>
<div>Hi,<br>
<br>
</div>
I think the syslog-ng service file needs to be updated so it will start after the network.service.<br>
</div>
We've had a bug report about this: <a href="https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsyslog-ng%2Fsyslog-ng%2Fissues%2F2667&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415260094&sdata=zI36BB2QBdlDUp0%2Bpz6Mv%2Fs22bc0nmcqXUG%2Fz%2FJlCKM%3D&reserved=0" originalsrc="https://github.com/syslog-ng/syslog-ng/issues/2667" shash="ct0kJAQKNhErl2XCIZIguRt2Pz792cIswsPgzvBeEFwtci0ut/4aqmb4gs0yAPW3PRZeDJn7KmwZED1BEOa9pYmj4JxY2xdcHfnmcVNW3R6VOnpzQcOjHV6UDv1cCrXpu+1CMxMxlok84PNWgvtfSjTT+CqR7lp0xNGIF6tS5sc=" target="_blank">
https://github.com/syslog-ng/syslog-ng/issues/2667</a><br>
<div><br>
</div>
<div>We fixed this in syslog-ng 3.25<br>
</div>
<div>We added the "Wants" and "After" options (see <a href="https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsyslog-ng%2Fsyslog-ng%2Fpull%2F2994%2Ffiles&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415260094&sdata=0yMaF5Yy%2BFxpsgg%2F3OZgz8YVFV%2FwCsQFxQ1WipMnyAI%3D&reserved=0" originalsrc="https://github.com/syslog-ng/syslog-ng/pull/2994/files" shash="fUKVfWlGUrESjKCtk+TXYDJlpWs0KAdO9uCYH+fQ6KahSXTon3FBe/EdiQ8sNKWiIpfnWCwD7CLtp/f/3f6BPnwYzu/GPLaQgjkJun6Qx8q4kLS4/2T5iPnDtZbK2uBlssdcrfMmTzFdAr2y3O9psEpxWoCriXkNMhBBZLnESHc=" target="_blank">
https://github.com/syslog-ng/syslog-ng/pull/2994/files</a>):<br>
<br>
[Unit]<br>
Description=System Logger Daemon<br>
Documentation=man:syslog-ng(8)<br>
Wants=network.target network-online.target<br>
After=network.target network-online.target<br>
<br>
</div>
<div>Maybe I'm wrong, but at first glance I think this could fix your boot issue.<br>
</div>
<div><br>
</div>
<div>Regards,<br>
</div>
<div>Gabor<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">Alexandre Santos <<a href="mailto:alexandre.rosas.santos@gmail.com" target="_blank">alexandre.rosas.santos@gmail.com</a>> ezt írta (időpont: 2020. jún. 26., P, 11:33):<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt"><font size="2"><span style="font-family:arial,sans-serif">Hi,</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt"><font size="2"><span style="font-family:arial,sans-serif">I have a configuration where one of my sources is a syslog source:</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt"><font size="2"><span style="font-family:arial,sans-serif">syslog(ip(127.1.1.1) transport("udp") port(514) keep-alive(no));</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt"><font size="2"><span style="font-family:arial,sans-serif"><br>
</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt; font-size:11pt"><font size="2"><span style="font-family:arial,sans-serif">But when the system starts up, the interface is not ready yet, and I get the following errors</span></font><span style="font-family:arial,sans-serif"><font size="2">:</font><br>
</span></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt; font-size:11pt"><span style="font-family:arial,sans-serif"><br>
</span></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt"><font size="2"><span style="font-family:monospace">Jun 26 09:17:50 localhost systemd[1]: Starting System Logger Daemon...<br>
Jun 26 09:17:52 localhost syslog-ng[2301]: [2020-06-26T09:17:52.485148] WARNING: With use-dns(no), dns-cache() will be forced to 'no' too!;<br>
Jun 26 09:17:52 localhost syslog-ng[2301]: [2020-06-26T09:17:52.487159] Current position not matches to the saved cursor position, seek to head; cursor='s=f62c0e80f50948deb29cf2d28230a<br>
Jun 26 09:17:52 localhost syslog-ng[2301]: [2020-06-26T09:17:52.487867] Error resolving hostname; host='127.1.1.1'<br>
Jun 26 09:17:52 localhost syslog-ng[2301]: [2020-06-26T09:17:52.487878] Error initializing message pipeline; plugin_name='syslog', location='/etc/syslog-ng/syslog-ng.conf:43:5'<br>
Jun 26 09:17:52 localhost systemd[1]: syslog-ng.service: Main process exited, code=exited, status=2/INVALIDARGUMENT<br>
Jun 26 09:17:52 localhost systemd[1]: syslog-ng.service: Failed with result 'exit-code'.<br>
Jun 26 09:17:52 localhost systemd[1]: Failed to start System Logger Daemon.<br>
Jun 26 09:17:52 localhost systemd[1]: syslog-ng.service: Service RestartSec=100ms expired, scheduling restart.<br>
Jun 26 09:17:52 localhost systemd[1]: syslog-ng.service: Scheduled restart job, restart counter is at 1.</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt"><font size="2"><span style="font-family:arial,sans-serif"></span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt; font-size:11pt"><font size="2"><span style="font-family:arial,sans-serif"><br>
</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt; font-size:11pt"><font size="2"><span style="font-family:arial,sans-serif">When the systemd reaches the 5 attempts it disables the syslog-ng.service.</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt; font-size:11pt"><font size="2"><span style="font-family:arial,sans-serif"><br>
</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt; font-size:11pt"><font size="2"><span style="font-family:arial,sans-serif">Do you know some way to fix this, by adding something, the syslog-ng configuration?</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt; font-size:11pt"><font size="2"><span style="font-family:arial,sans-serif"><br>
</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt; font-size:11pt"><font size="2"><span style="font-family:arial,sans-serif">Thanks in Advance,</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt; font-size:11pt"><font size="2"><span style="font-family:arial,sans-serif">Alex<br>
</span></font></p>
<p class="x_MsoNormal" style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:"Calibri",sans-serif">
<i><span style="font-size:10pt; color:rgb(197,90,17)"><span></span></span></i></p>
</div>
______________________________________________________________________________<br>
Member info: <a href="https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.balabit.hu%2Fmailman%2Flistinfo%2Fsyslog-ng&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415270052&sdata=es%2BBqL0MAbI26UbFy1NbBxe5Ey7j%2BvMdJ9bjUj6U63Q%3D&reserved=0" originalsrc="https://lists.balabit.hu/mailman/listinfo/syslog-ng" shash="vT4DAiXOMr75qpiNmUs4oi2t8ReFDFKSxLh4sPsSVwh9Q5uf2Y1gBy9v5d87NKcrPC11bTkcZUhFCotaqzDM7DzM0qV36qj53rGw2ne7UpijYbJh0hZ3T202ZbdLHF63FRRUwrwMUXCJbc7w/Qv7Xi+FY5q4phnASDfs22WEMTs=" rel="noreferrer" target="_blank">
https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fsupport%2Fdocumentation%2F%3Fproduct%3Dsyslog-ng&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415270052&sdata=6vKRjMNO%2FmrDtWmuLMGH%2FTm91jICMMRwHvL8%2FV76TGs%3D&reserved=0" originalsrc="http://www.balabit.com/support/documentation/?product=syslog-ng" shash="iq8FbR7dKHf2v/vdhE5xOgOf/tcnSpR6hnAvGmof4aDtkxPeMb5+kcjXlVdNUtI/ZrglTLn3ITuluctr9nVNGCuVRXQs/bBcmojD9PKyUXAUmcGaV6ajQZQm9Py3l6KQvxGW3wRHpaTRsCaRqhvjKHpeIeZi2LgvOMJDdy01SDY=" rel="noreferrer" target="_blank">
http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fwiki%2Fsyslog-ng-faq&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415270052&sdata=dAnb1vkFH65snzchDoRcHvAcMBVGPCcc3UfiYWFx1qI%3D&reserved=0" originalsrc="http://www.balabit.com/wiki/syslog-ng-faq" shash="tB49VqPqKuRyO+QnHPCzqWJfw4yGQb2EqXl1Ej7d6c18v/sZzPMPCqyXwAuJew+H0qP5BZfcgf5GEL5ZwUeApvNghexZPgGH9B++dm4i0d4Jk+aryGgDB9lc84DljozAvsa09GHYL9ErM9AAXy7fhPPt9KBfnvCWdvhvJvBavjU=" rel="noreferrer" target="_blank">
http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</blockquote>
</div>
______________________________________________________________________________<br>
Member info: <a href="https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.balabit.hu%2Fmailman%2Flistinfo%2Fsyslog-ng&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415280012&sdata=qYvFnQB%2FpAbSfzQwfPPDug0KijG%2BTBBCMlRLv5jrtNc%3D&reserved=0" originalsrc="https://lists.balabit.hu/mailman/listinfo/syslog-ng" shash="zPMewJatxIuU5fuhxMO1B2J1a/kpf9MHJ0cs7LhaN9FvxvhNM1bsCnOyfpsc9bPRs45jJ/zc3MgV5gv0X2ASbK69p7MKlrfO8TsakCvMB07WbLkMEM2Wuz49Qi+ejlDb8OaQqcxkXE4gHEpVNfB5yrNbhOeGjrF6R2F2B76Bar0=" rel="noreferrer" target="_blank">
https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fsupport%2Fdocumentation%2F%3Fproduct%3Dsyslog-ng&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415280012&sdata=oW9SKARshDLoDXB7ztrV3GPhwa347TwkYXmhzKZz1CE%3D&reserved=0" originalsrc="http://www.balabit.com/support/documentation/?product=syslog-ng" shash="qHE2GfxJL1VWfsltKt+/rJum/DjBT6Blaw5CSjPwXQpu8NkJbCVLAqi/cQQCX18uk0D8GgdgbdrSwR80XSwrUNv0C2eLJkUETtYCO7e27hVmFo8Z7HHCelJekNiHPUHepmwG8YDw36SLR7cnev1uJ8ACoFWNSznn5Byn3QJeXG0=" rel="noreferrer" target="_blank">
http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fwiki%2Fsyslog-ng-faq&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415289967&sdata=LJIsWFP1r%2BngtQ%2Fd81Gs4NstQQDjoXaCw02oYMoQ044%3D&reserved=0" originalsrc="http://www.balabit.com/wiki/syslog-ng-faq" shash="INBqO4KWPjJ56VQ2tIxWqZK48JAbqHlS/zNvnPY3vim8CgcKPIsgq9AMlKv+dREpfZ49sbW2/1pcUlvlglGXAljkJ83KLa2a1+qwhKy9bV09Q5MK368KL0xpjXwp8u3hYJQgBIE1IUajdsNiRU0quvFe/wgjKb7QfxLrVL6S2Zc=" rel="noreferrer" target="_blank">
http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</blockquote>
</div>
______________________________________________________________________________<br>
Member info: <a href="https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.balabit.hu%2Fmailman%2Flistinfo%2Fsyslog-ng&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415289967&sdata=KMT4aME%2F0aLQuTGNnmqEAGJ2%2B8RH1piD%2FLB0Yj61KYw%3D&reserved=0" originalsrc="https://lists.balabit.hu/mailman/listinfo/syslog-ng" shash="jdnmE9KQq5UAyafZdg/Xx1rW3wphn7uZD1c6ZJ+c1CeENevc6wq9rzRuBCTFa5+N5Y0uEGmIHS1ikwt5qxqiCcuGzqDun6UaOBQmOksEm5xA/JLoO2RJlkCqM4j7/v6f0HA3k4EpkVwXvmImktmQWS1hkwiV06ujJtNRAdJeApw=" rel="noreferrer" target="_blank">
https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fsupport%2Fdocumentation%2F%3Fproduct%3Dsyslog-ng&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415289967&sdata=1YJILOOKkpKFvRJu4sk4eutj8EPP%2Bvnm4uD8JZtqaCE%3D&reserved=0" originalsrc="http://www.balabit.com/support/documentation/?product=syslog-ng" shash="XBjI7+zwqOEterJVpxHsnJ7lAzeT7Tv9hnM5lWgYgN6i/IhLFYrdLeI5X3vFph4bkGNKQao/PqSH0Hqvmn66GegEig0bXTgnY65QH/POwgupLMIqtpZZwZJL8AsQIssNvj6BRH/b7xr2H/ARbdS8GJBLIgoSLLvWw7LtpeZTiY0=" rel="noreferrer" target="_blank">
http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fwiki%2Fsyslog-ng-faq&data=02%7C01%7CLaszlo.Szemere%40oneidentity.com%7Cd16d1a99376449e266b208d82d6854b8%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637309273415299921&sdata=ycQ%2FyBTZqU3rLwg59vRonz2ZATUc6HRqLQatxH1huYc%3D&reserved=0" originalsrc="http://www.balabit.com/wiki/syslog-ng-faq" shash="lrvFVp9JXabH6ELavGuwDXvVtsFKK/WHXV7HXYn2bAZ8AP+airLjLif+4ZwRWjcfiiCqW8+4G1JS98xQA240B2VaTv1d3IrViXjwtXZMO83kaENHccLFbDIbuhMbUkKHhqUNgDNx/SADAfYDSIWfmCcywxe+1ONb5PMws6lnyTI=" rel="noreferrer" target="_blank">
http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</blockquote>
</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr" class="x_gmail_signature">Bazsi</div>
</div>
</div>
</body>
</html>