<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">This name is already in the /etc/hosts
file. I am attempting to listen on localhost.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">source local {<br>
network(localip(localhost) transport("tcp") port(1514)
max_connections(100) log_fetch_limit(500) log_iw_size(10000)
flags(no-multi-line,syslog-protocol) tags(uvic.local)
keep-timestamp(no) );<br>
};<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">and the /etc/hosts file has</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">127.0.0.1 localhost
localhost.localdomain localhost4 localhost4.localdomain4<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">and on reboot ...</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">05:13:28.891 host daemon.notice
systemd[1]: syslog-ng.service: main process exited, code=exited,
status=2/INVALIDARGUMENT<br>
05:13:28.891 host daemon.err systemd[1]: Failed to start System
Logger Daemon.<br>
05:13:28.891 host daemon.notice systemd[1]: Unit syslog-ng.service
entered failed state.<br>
05:13:28.891 host daemon.warning systemd[1]: syslog-ng.service
failed.<br>
05:13:29.007 host daemon.info systemd[1]: syslog-ng.service
holdoff time over, scheduling restart.<br>
05:13:29.009 host daemon.info systemd[1]: Stopped System Logger
Daemon.<br>
<br>
05:13:29.009 host daemon.info systemd[1]: Starting System Logger
Daemon...<br>
05:13:29.190 host daemon.info syslog-ng[6366]: [05:13:29.189991]
Error resolving hostname; host='localhost'<br>
05:13:29.197 host daemon.notice systemd[1]: syslog-ng.service:
main process exited, code=exited, status=2/INVALIDARGUMENT<br>
05:13:29.197 host daemon.err systemd[1]: Failed to start System
Logger Daemon.<br>
05:13:29.197 host daemon.notice systemd[1]: Unit syslog-ng.service
entered failed state.<br>
05:13:29.198 host daemon.warning systemd[1]: syslog-ng.service
failed.<br>
05:13:29.345 host daemon.info systemd[1]: syslog-ng.service
holdoff time over, scheduling restart.<br>
05:13:29.346 host daemon.info systemd[1]: Stopped System Logger
Daemon.<br>
<br>
05:13:29.346 host daemon.info systemd[1]: Starting System Logger
Daemon...<br>
05:13:29.412 host daemon.info syslog-ng[6457]: [05:13:29.412745]
Error resolving hostname; host='localhost'<br>
05:13:29.415 host daemon.notice systemd[1]: syslog-ng.service:
main process exited, code=exited, status=2/INVALIDARGUMENT<br>
05:13:29.415 host daemon.err systemd[1]: Failed to start System
Logger Daemon.<br>
05:13:29.415 host daemon.notice systemd[1]: Unit syslog-ng.service
entered failed state.<br>
05:13:29.415 host daemon.warning systemd[1]: syslog-ng.service
failed.<br>
05:13:29.556 host daemon.info systemd[1]: syslog-ng.service
holdoff time over, scheduling restart.<br>
05:13:29.556 host daemon.info systemd[1]: Stopped System Logger
Daemon.<br>
<br>
05:13:29.557 host daemon.info systemd[1]: Starting System Logger
Daemon...<br>
05:13:29.623 host daemon.info syslog-ng[6487]: [05:13:29.623206]
Error resolving hostname; host='localhost'<br>
05:13:29.626 host daemon.notice systemd[1]: syslog-ng.service:
main process exited, code=exited, status=2/INVALIDARGUMENT<br>
05:13:29.626 host daemon.err systemd[1]: Failed to start System
Logger Daemon.<br>
05:13:29.626 host daemon.notice systemd[1]: Unit syslog-ng.service
entered failed state.<br>
05:13:29.626 host daemon.warning systemd[1]: syslog-ng.service
failed.<br>
05:13:29.806 host daemon.info systemd[1]: syslog-ng.service
holdoff time over, scheduling restart.<br>
05:13:29.807 host daemon.info systemd[1]: Stopped System Logger
Daemon.<br>
<br>
05:13:29.807 host daemon.info systemd[1]: Starting System Logger
Daemon...<br>
05:13:29.867 host daemon.info syslog-ng[6537]: [05:13:29.867292]
Error resolving hostname; host='localhost'<br>
05:13:29.870 host daemon.notice systemd[1]: syslog-ng.service:
main process exited, code=exited, status=2/INVALIDARGUMENT<br>
05:13:29.870 host daemon.err systemd[1]: Failed to start System
Logger Daemon.<br>
05:13:29.870 host daemon.notice systemd[1]: Unit syslog-ng.service
entered failed state.<br>
05:13:29.870 host daemon.warning systemd[1]: syslog-ng.service
failed.<br>
<br>
05:13:29.893 host daemon.info network[6435]: Bringing up loopback
interface: [ OK ]<br>
<br>
05:13:30.009 host daemon.info systemd[1]: syslog-ng.service
holdoff time over, scheduling restart.<br>
05:13:30.009 host daemon.info systemd[1]: Stopped System Logger
Daemon.<br>
05:13:30.009 host daemon.warning systemd[1]: start request
repeated too quickly for syslog-ng.service<br>
05:13:30.010 host daemon.err systemd[1]: Failed to start System
Logger Daemon.<br>
05:13:30.010 host daemon.notice systemd[1]: Unit syslog-ng.service
entered failed state.<br>
05:13:30.010 host daemon.warning systemd[1]: syslog-ng.service
failed.<br>
<br>
05:13:34.214 host daemon.info network[6435]: Bringing up interface
eth0: [ OK ]<br>
<br>
05:13:34.242 host daemon.info systemd[1]: Reached target Network.<br>
<br>
05:13:37.651 host lpr.info cupsd[6665]: Listening to 127.0.0.1:631
on fd 10...<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">After this (when I can log in) a simple
"service syslog-ng start" will correctly start the syslog-ng
service.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">the rsyslog package does have systemd
unit file definitions of<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">
<div class="moz-cite-prefix">[Unit]<br>
</div>
Wants=network.target network-online.target<br>
After=network.target network-online.target<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">but that might be Redhat's way of
saying that systemd-journal is good enough when you don't have
networking since</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">[Install]<br>
WantedBy=multi-user.target</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">is also present meaning that rsyslog is
only started when a multi-user boot is done.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Since the syslog-ng.service file also
includes</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">[Install]<br>
WantedBy=multi-user.target<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">I think that it is reasonable to add
the unit definitions of</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">[Unit]<br>
</div>
<div class="moz-cite-prefix">Wants=network.target
network-online.target<br>
After=network.target network-online.target<br>
<br>
</div>
<div class="moz-cite-prefix">and the problem just goes away for
normal boot up environments.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">I think I'll post this as a packaging
systemd unit file definition bug.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 4/17/19 11:29 PM, Scheidler, Balázs
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CANWQT2NnLoYma6NdRfWAL5QmMq9eUr5K1wb8UCPyc93SUAmK2g@mail.gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div dir="auto">
<div>You mean bind address is specified by dns? You could add
that to the hosts file.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Bazsi<br>
<br>
<div class="gmail_quote" dir="auto">
<div dir="ltr">On Wed, Apr 17, 2019, 23:48 Evan Rempel <<a
href="mailto:erempel@uvic.ca" moz-do-not-send="true">erempel@uvic.ca</a>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">I've
been looking at an interesting scenario on Redhat 7
(systemd) where syslog-ng fails to start because it can
not resolve a network source name. This happens because
the network has not started. Systemd attempts to restart
syslog-ng a few times and then decides that it is
restarting syslog-ng too quickly and gives up on it.<br>
<br>
<br>
2019-04-17T05:13:30.009 daemon.warning systemd[1]: start
request repeated too quickly for syslog-ng.service<br>
2019-04-17T05:13:30.010 daemon.err systemd[1]: Failed to
start System Logger Daemon.<br>
2019-04-17T05:13:30.010 daemon.notice systemd[1]: Unit
syslog-ng.service entered failed state.<br>
2019-04-17T05:13:30.010 daemon.warning systemd[1]:
syslog-ng.service failed.<br>
<br>
<br>
My first reaction was to add the
"Wants=network-online.target" to the service definition to
make syslog-ng start after the network has started, but
that would mean that if I boot up without a network that
syslog-ng would never start, and that seems incorrect to
me.<br>
<br>
Is there a way to to configure a network source to be
optional and continue to retry binding to it after
startup?<br>
<br>
How do others handle this issue?<br>
<br>
-- <br>
Evan<br>
<br>
______________________________________________________________________________<br>
Member info: <a
href="https://lists.balabit.hu/mailman/listinfo/syslog-ng"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a
href="http://www.balabit.com/support/documentation/?product=syslog-ng"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</blockquote>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">______________________________________________________________________________
Member info: <a class="moz-txt-link-freetext" href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a>
Documentation: <a class="moz-txt-link-freetext" href="http://www.balabit.com/support/documentation/?product=syslog-ng">http://www.balabit.com/support/documentation/?product=syslog-ng</a>
FAQ: <a class="moz-txt-link-freetext" href="http://www.balabit.com/wiki/syslog-ng-faq">http://www.balabit.com/wiki/syslog-ng-faq</a>
</pre>
</blockquote>
<p><br>
</p>
<pre class="moz-signature" cols="500">--
Evan Rempel <a class="moz-txt-link-abbreviated" href="mailto:erempel@uvic.ca">erempel@uvic.ca</a>
Senior Systems Administrator 250.721.7691
Data Centre Services, University Systems, University of Victoria
</pre>
</body>
</html>