<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - systemd implicitly depends on all compatible syslog daemons to support the "-n" switch for foreground mode"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=61324">61324</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>systemd implicitly depends on all compatible syslog daemons to support the "-n" switch for foreground mode
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nsane457@gmail.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>systemctl would fail to start syslog-ng.service with the following journal
debug output:

...
Feb 22 16:00:43 Laptop-PC systemd[1]: Starting System Logging Service...
Feb 22 16:00:43 Laptop-PC systemd[1]: About to execute /usr/sbin/syslog-ng -n
Feb 22 16:00:43 Laptop-PC systemd[1]: Forked /usr/sbin/syslog-ng as 5167
Feb 22 16:00:43 Laptop-PC systemd[1]: syslog-ng.service changed failed ->
running
Feb 22 16:00:43 Laptop-PC systemd[1]: Job syslog-ng.service/start finished,
result=done
Feb 22 16:00:43 Laptop-PC systemd[1]: Started System Logging Service.
Feb 22 16:00:43 Laptop-PC systemd[1]: Accepted connection on private bus.
Feb 22 16:00:43 Laptop-PC systemd[1]: Got D-Bus request:
org.freedesktop.systemd1.Ag...ent
Feb 22 16:00:43 Laptop-PC systemd[1]: Received SIGCHLD from PID 5167
(syslog-ng).
Feb 22 16:00:43 Laptop-PC systemd[1]: Got SIGCHLD for process 5167 (syslog-ng)
Feb 22 16:00:43 Laptop-PC systemd[1]: syslog-ng.service: main process exited,
code=e...URE
Feb 22 16:00:43 Laptop-PC systemd[1]: Got D-Bus request:
org.freedesktop.DBus.Local....cal
Feb 22 16:00:43 Laptop-PC systemd[1]: Child 5167 died (code=exited,
status=1/FAILURE)
Feb 22 16:00:43 Laptop-PC systemd[1]: Child 5167 belongs to syslog-ng.service
Feb 22 16:00:43 Laptop-PC systemd[1]: syslog.socket got notified about service
death...no)
Feb 22 16:00:43 Laptop-PC systemd[1]: syslog.socket changed running ->
listening
Feb 22 16:00:43 Laptop-PC systemd[1]: syslog-ng.service changed running ->
failed
Feb 22 16:00:43 Laptop-PC systemd[1]: Unit syslog-ng.service entered failed
state
Feb 22 16:00:43 Laptop-PC systemd[1]: Incoming traffic on syslog.socket
Feb 22 16:00:43 Laptop-PC systemd[1]: Trying to enqueue job
syslog-ng.service/start/...ace
Feb 22 16:00:43 Laptop-PC systemd[1]: Installed new job syslog-ng.service/start
as 2745
Feb 22 16:00:43 Laptop-PC systemd[1]: Enqueued job syslog-ng.service/start as
2745
Feb 22 16:00:43 Laptop-PC systemd[1]: syslog.socket changed listening ->
running
...


In spite of the line "ExecStart=/usr/sbin/syslog-ng -F" in syslog-ng.service
file, the journal line "About to execute /usr/sbin/syslog-ng -n" implies it was
ignoring the "-F" flag.

The syslog-ng daemon doesn't support the "-n" flag (at least not version
<span class="quote">>=3.4.1). "/usr/sbin/syslog-ng -n; echo $?" returns 1, corresponding to the</span >
journal output "code=exited, status=1/FAILURE".

To test if this was the problem, I altered the gprocess.c file in the syslog-ng
source to accept "-n", instead of "-F", to enable foregrounding.
After recompiling and installing, syslog-ng.service started and remained active
without a problem.
The journal output is:

...
Feb 22 20:46:23 Laptop-PC systemd[1]: syslog-ng.service changed dead -> running
Feb 22 20:46:23 Laptop-PC systemd[1]: Job syslog-ng.service/start finished,
result=done
Feb 22 20:46:23 Laptop-PC systemd[1]: Incoming traffic on syslog.socket
Feb 22 20:46:23 Laptop-PC systemd[1]: syslog.socket changed listening ->
running
Feb 22 20:46:23 Laptop-PC systemd[1]: Accepted connection on private bus.
Feb 22 20:46:23 Laptop-PC systemd[1]: Got D-Bus request:
org.freedesktop.DBus.Local.Disconnected()
Feb 22 20:46:23 Laptop-PC systemd[1]: Got D-Bus request:
org.freedesktop.systemd1.Agent.Released()
Feb 22 20:46:23 Laptop-PC systemd[1]: Got D-Bus request:
org.freedesktop.DBus.Local.Disconnected()
...

The following is version info:
Laptop-PC ~ # journalctl --version
systemd 197
+PAM +LIBWRAP -AUDIT -SELINUX +IMA -SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ

Laptop-PC ~ # syslog-ng --version
syslog-ng 3.4.1
Installer-Version: 3.4.1
Revision: 
Compile-Date: Feb 22 2013 19:58:31
Available-Modules:
cryptofuncs,system-source,syslogformat,json-plugin,afsocket,afprog,afsocket-tls,afsocket-notls,basicfuncs,dbparser,afuser,confgen,affile,afsql,csvparser,afamqp
Enable-Debug: off
Enable-GProf: off
Enable-Memtrace: off
Enable-IPv6: on
Enable-Spoof-Source: off
Enable-TCP-Wrapper: on
Enable-Linux-Caps: off
Enable-Pcre: on</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>