Re: help with sockets and services and inetd-like workflows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@.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@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@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@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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux