[systemd-devel] help with sockets and services and inetd-like workflows

Matt Zagrabelny mzagrabe at d.umn.edu
Mon Mar 22 02:13:22 UTC 2021


Greetings,

I'm running systemd 241-7~deb10u6, Debian 10 (Buster).

I am attempting to have an inetd like service run, where systemd listens on
a port (TCP 9000) and passes the data to a python3 script's STDIN.

Here are my unit files:

==> /etc/systemd/system/cdr-adjunct at .service <==
[Unit]
Description=Call Detail Record Adjunct Processor

[Service]
ExecStart=/opt/src/cdr-adjunct/python/cdr-adjunct.py
StandardInput=socket
User=phone

==> /etc/systemd/system/cdr-adjunct.socket <==
[Unit]
Description=Socket for Call Detail Record Adjunct Processor

[Socket]
ListenStream=9000
Accept=yes

[Install]
WantedBy=sockets.target

While the mechanics work, there are, seemingly, issues in my process. I'm
seeing over 2000 failed units for the service in question.

$ sudo systemctl --state=failed
  UNIT                                                          LOAD
ACTIVE SUB    DESCRIPTION
● cdr-adjunct at 0-131.212.109.135:9000-10.27.0.3:31541.service    loaded
failed failed Call Detail Record Adjunct Processor (10.27.0.3:31541)
● cdr-adjunct at 1-131.212.109.135:9000-10.27.0.3:32034.service    loaded
failed failed Call Detail Record Adjunct Processor (10.27.0.3:32034)
[snip ~2000 lines]
● cdr-adjunct at 999-131.212.109.135:9000-10.27.0.3:10955.service  loaded
failed failed Call Detail Record Adjunct Processor (10.27.0.3:10955)

My python3 script processes STDIN as such:

        for line in sys.stdin:

         #do stuff

I'm a little confused as to where to look to determine why I'm seeing so
many failed units.

Any help or suggestions are very welcome.

Thank you!

-m
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20210321/d82ce3c6/attachment.htm>


More information about the systemd-devel mailing list