<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/112723>112723</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            lldb-server: allow socket activation with server mode
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          nolange
      </td>
    </tr>
</table>

<pre>
    Hello,

for some embedded system I would like to be able to start llvm-server on-demand via
systemd [socket activation](https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.html).

The process will end up receiving env variables like `LISTEN_FDS=1`, `LISTEN_PID=<own_pid>`,
and should then have an listening socket passed in fd 3.

Proposed service files:

``` ini
# lldb-server.socket
[Unit]
Description=llvm-server listen socket

[Socket]
ListenStream=0.0.0.0:1234
```

``` ini
# lldb-server.service
[Unit]
Description=Server for LLDB, listen on port 1234

[Service]
# take over open socket, shutdown  if no open connection for 60 seconds
ExecStart=/usr/local/bin/lldb-server p --server --activate --timeout 60
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVEGPszYQ_TXmMgoCG5Jw4LC7LOpKq-qT8vW8MngIboyNbAP9_n1lILvZ9tIqUWI85s17b8bDnZNXjViS_JnkVcQn3xtbaqO4vmLUGPGr_A2VMoS-kKQiydP22xkLzgwIODQoBApwv5zHAd5gMZMSoOQNwRtoEHij1qXz3HpQah4ODu2MFow-CBy4FjBLvgFvMAJI_uxMe0MPvPVy5l4aTfKK0HPv_egIeyK0JrReliXuLKJAd_NmjI29Elo70_mFWwzLDZDQeuCa0Fpxj86HgPhQ0nnUH51wce8HRWgRP4r82SOM1rToHCxSKUAtYBrBYotylvoKqGeYuZVBots0k2Py_nb5-fr7R11dCKtSckwIfXnY__FWEVYR9mIW_TFKQdjrdmbLGuxw_Wqi71FDz2cErmEjG7LuxozcORQgNXQC2DfmP6wZTQgGo2WL0EmFq2kPh0LS9QtSy32LMlBKNHuB4i3THsuf_9DShyKszxW61spxLQyrHsu6MYVvL98hLtvmHeR9PXrxFvlAWJXE64ewp5Sy7B80_y_3Tfp_IX_ZeIemfn-vnkO5dg1Gw2ishwc6n0p2_DtkyO_5DcGsrT1-OUBfwPWTF2bRALIDbbZwa7TGNnBYUx8TcNgaLdwG-PoXtpdwZ0K30HpyNrSvabkitG7k2sxfemGEw315OOyXBuFw8HJAM3n4NPBuXSRKJgpW8AjL9ESL9HTKj8eoL08NNh0XWcYxOdOiQJbm53OBp6bAgp1ZJEua0CxN0lOaJ8cki5EmKYosRd41WUdbkiU4cKni0BbhTkbSuQnLNKUnyiLFG1RunTmUalxgjRJKwwiy5dpLzXR1JEtCHdwXjJdeYfkgm7An4EqZBf41LmCRvofdksEIjCaryu_j4yp9PzVxa4bVzfn-dxit-RPbMCdWbo7Qeic_l_TvAAAA__9x2aRY">