<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="gmail_quote"><div dir="ltr" class="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="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="gmail_quote"><div dir="ltr" class="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="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://github.com/syslog-ng/syslog-ng/issues/2667" 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://github.com/syslog-ng/syslog-ng/pull/2994/files" 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="gmail_quote"><div dir="ltr" class="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="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="MsoNormal" style="margin:0cm 0cm 0.0001pt"><font size="2"><span style="font-family:arial,sans-serif">Hi,</span></font></p><p class="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="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="MsoNormal" style="margin:0cm 0cm 0.0001pt"><font size="2"><span style="font-family:arial,sans-serif"><br></span></font></p><p class="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="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt"><span style="font-family:arial,sans-serif"><br></span></p><p class="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="MsoNormal" style="margin:0cm 0cm 0.0001pt"><font size="2"><span style="font-family:arial,sans-serif"></span></font></p><p class="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="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="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="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="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="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="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="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://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</blockquote></div>
______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</blockquote></div>
______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" 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="gmail_signature">Bazsi</div>