<div dir="ltr"><div>There are three modes in which syslog-ng can start, "--process-mode background" is probably the one that best matches other daemons that don't have their own supervisor (which is not needed as systemd behaves as one).<br><br></div>The funny thing is that I have just tried my local syslog-ng installation on ubuntu wily, which is systemd based and is working just fine:<br><br>$ systemctl status syslog-ng<br>● syslog-ng.service - System Logger Daemon<br> Loaded: loaded (/lib/systemd/system/syslog-ng.service; enabled; vendor preset: enabled)<br> Active: active (running) since Wed 2016-04-13 08:48:28 CEST; 29s ago<br> Docs: man:syslog-ng(8)<br> Main PID: 17470 (syslog-ng)<br> Memory: 1.4M<br> CPU: 26ms<br> CGroup: /system.slice/syslog-ng.service<br> └─17470 /usr/sbin/syslog-ng -F<br><br>Apr 13 08:48:28 bzorp systemd[1]: Starting System Logger Daemon...<br>Apr 13 08:48:28 bzorp systemd[1]: Started System Logger Daemon.<br><br>$ systemctl stop syslog-ng<br>$ systemctl start syslog-ng<br><br>$ syslog-ng -V<br>syslog-ng 3.5.6<br>Installer-Version: 3.5.6<br>Revision: 3.5.6-2build1 [@416d315] (Ubuntu/15.10)<br>Compile-Date: Jul 29 2015 03:15:39<br>Available-Modules: basicfuncs,syslogformat,affile,afprog,afsocket,json-plugin,dbparser,linux-kmsg-format,afmongodb,afsql,afstomp,system-source,redis,confgen,tfgeoip,afsocket-notls,afsocket-tls,csvparser,afsmtp,afuser,cryptofuncs,afamqp<br>Enable-Debug: off<br>Enable-GProf: off<br>Enable-Memtrace: off<br>Enable-IPv6: on<br>Enable-Spoof-Source: on<br>Enable-TCP-Wrapper: on<br>Enable-Linux-Caps: on<br>Enable-Pcre: on<br><br><br>$ dpkg -l systemd<br>Desired=Unknown/Install/Remove/Purge/Hold<br>| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend<br>|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)<br>||/ Name Version Architecture Description<br>+++-===========================================-==========================-==========================-============================================================================================<br>ii systemd 225-1ubuntu9.1 amd64 system and service manager<br><br><br><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">-- <br>Bazsi<br></div></div></div>
<br><div class="gmail_quote">On Wed, Apr 13, 2016 at 8:31 AM, Scot Needy <span dir="ltr"><<a href="mailto:scotrn@gmail.com" target="_blank">scotrn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Thanks for the response, The -F flag was based on other posts. <div>If I remove the -F it does return but systemd keeps restarting it. </div><div><div class="h5"><div><br></div><div><br></div><div><br></div><div><br><div><blockquote type="cite"><div>On Apr 13, 2016, at 2:23 AM, Scheidler, Balázs <<a href="mailto:balazs.scheidler@balabit.com" target="_blank">balazs.scheidler@balabit.com</a>> wrote:</div><br><div><p dir="ltr">-F specifies that syslog-ng should stay in the foreground.</p><p dir="ltr">I assumed that it was needed for systemd. You could try --process-mode background</p><p dir="ltr">That causes syslog-ng to go to the background but without its own supervisor.</p>
<div class="gmail_quote">On Apr 12, 2016 9:00 PM, "Scot Needy" <<a href="mailto:scotrn@gmail.com" target="_blank">scotrn@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div><br></div><div>Hi, </div><div><br></div><div>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. </div><div>From systemd I think there is something missing in the control files that lets syslog-ng report that is started successfully. </div><div><br></div><div>When I add -F to SYSLOGNG_OPTS then systemctl start syslog-g.service never returns but syslog-ng does start. </div><div><br></div><div>Compiled syslog-ng syslog-ng 3.8.0alpha0 no problems. </div><div>On the command line syslog-ng will start fine. </div><div> /opt/syslog-ng/sbin/syslog-ng -f /opt/syslog-ng/etc/syslog-ng.conf -p /var/run/syslogd.pid</div><div><br></div><div><br></div><div>Using contrib/systemd/syslog-ng.service as an example I created /usr/lib/systemd/system/syslog-ng.service </div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font size="1">[Unit]</font></div></div><div><div><font size="1">Description=System Logger Daemon</font></div></div><div><div><font size="1">Documentation=man:syslog-ng(8)</font></div></div><div><div><font size="1"><br></font></div></div><div><div><font size="1">[Service]</font></div></div><div><div><font size="1">Type=notify</font></div></div><div><div><font size="1">ExecStart=/opt/syslog-ng/sbin/syslog-ng $SYSLOGNG_OPTS</font></div></div><div><div><font size="1">ExecReload=/bin/kill -HUP $MAINPID</font></div></div><div><div><font size="1">EnvironmentFile=-/opt/syslog-ng/etc/syslog-ng.env</font></div></div><div><div><font size="1">StandardOutput=journal</font></div></div><div><div><font size="1">StandardError=journal</font></div></div><div><div><font size="1">Restart=on-failure</font></div></div><div><div><font size="1"><br></font></div></div><div><div><font size="1">[Install]</font></div></div><div><div><font size="1">WantedBy=multi-user.target</font></div></div><div><br></div><div><br></div><div><div>cat /opt/syslog-ng/etc/syslog-ng.env</div><div>LD_LIBRARY_PATH=/usr/java/jdk1.8.0_77/jre/lib/amd64/server:$LD_LIBRARY_PATH</div><div>SYSLOGNG_OPTS="-f /opt/syslog-ng/etc/syslog-ng.conf -p /var/run/syslogd.pid"</div></div><div><br></div><div><br></div></blockquote><font size="1">systemctl daemon-reload</font><div><font size="1">systemctl restart systemd-journald</font></div><div><font size="1">systemctl start syslog-ng.service</font></div><div><font size="1">systemctl status syslog-ng.service</font></div><div><font size="1"><div>● syslog-ng.service - System Logger Daemon</div><div> Loaded: loaded (/usr/lib/systemd/system/syslog-ng.service; enabled; vendor preset: enabled)</div><div> Active: inactive (dead) since Tue 2016-04-12 14:51:04 EDT; 29s ago</div><div> Docs: man:syslog-ng(8)</div><div> Process: 2494 ExecStart=/opt/syslog-ng/sbin/syslog-ng $SYSLOGNG_OPTS (code=exited, status=0/SUCCESS)</div><div> Main PID: 2494 (code=exited, status=0/SUCCESS)</div></font></div><div><font size="1"><br></font></div><div><font size="1"><br></font></div><div><font size="1"><div>Apr 12 14:41:08 loghost systemd[1]: Unit syslog-ng.service entered failed state.</div><div>Apr 12 14:41:08 loghost systemd[1]: syslog-ng.service failed.</div><div>Apr 12 14:41:08 loghost systemd[1]: syslog-ng.service holdoff time over, scheduling restart.</div><div>Apr 12 14:41:08 loghost systemd[1]: Starting System Logger Daemon...</div></font></div><div><font size="1"><br></font></div><div><font size="1"><br></font></div><div><font size="1">I can see syslog-ng starting and stoping over and over from /var/log/messages </font></div><div><font size="1"><br></font><div><br></div></div></div><br>______________________________________________________________________________<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>
<br></blockquote></div>
______________________________________________________________________________<br>Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br><br></div></blockquote></div><br></div></div></div></div><br>______________________________________________________________________________<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>
<br></blockquote></div><br></div>