[systemd-devel] help with sockets and services and inetd-like workflows
Mantas Mikulėnas
grawity at gmail.com
Mon Mar 22 06:59:31 UTC 2021
I would suggest adding StandardError=journal, so that you get to see the
Python exceptions when they happen.
On Mon, Mar 22, 2021, 04:21 Matt Zagrabelny <mzagrabe at d.umn.edu> wrote:
> 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
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20210322/48b12f3a/attachment.htm>
More information about the systemd-devel
mailing list