how to configure xinetd to run a python script?

When connecting to the server, as I understand it, the script should run here is the script itself

#! /usr/bin/python
import sys
print "Enter your name:\n"
sys.stdout.flush()
my_name = sys.stdin.readline().strip()
print "Your name is %s" % my_name
sys.stdout.flush()
quit()

File /etc/xinetd. conf

 # Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{

# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info

}

includedir /etc/xinetd.d
service mon
{
        port = 9090
        socket_type = dgram
        protocol = tcp
        user = root
        group = root
        server = /root/monserv/first.py
        type = UNLISTED
        wait = yes
        instances = 20
        cps = 20 10
        disable = no
}

What's wrong? Why doesn't it work? How to do it right? The browser is already bursting with tabs with information, according to which everything seems to be correct...

Author: Сергей, 2018-08-23

1 answers

Problem solved! The trouble was in access to /root/monserv/first.py, after moving the script to /usr/, everything worked

 1
Author: Сергей, 2018-08-24 00:01:45