<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - systemd.exec: add ExecFail option to start diagexec"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=89840">89840</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>systemd.exec: add ExecFail option to start diagexec
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

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

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

        <tr>
          <th>Reporter</th>
          <td>alban.crequy@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When starting a systemd unit file, it might print the following error based on
errno=ENOENT:

testscript[9959]: Failed at step EXEC spawning /testscript: No such file or
directory

This could mean /testscript is missing, or ld-2.19.so is missing or the
interpreter in the shebang is missing.

But the error message is not precise enough to know. The kernel does not give
more details when execve() fails with errno=ENOENT.

In order to print better error messages, we could have an option ExecFail in
the unit file:

ExecFail=/usr/bin/diagexec

It would start the diagnostic tool to guess why execve() returned ENOENT.

The code for diagexec is there:

<a href="https://github.com/coreos/rocket/blob/master/stage1/rootfs/diagexec/diagexec.c#L58">https://github.com/coreos/rocket/blob/master/stage1/rootfs/diagexec/diagexec.c#L58</a></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>