Executing script on receiving incoming connection with xinetd

后端 未结 2 1076
面向向阳花
面向向阳花 2020-12-18 12:14

I want xinetd to execute a shell script when a connection is received on a certain port. To accomplish this, followed this tutorial: [enter link description here][1]

相关标签:
2条回答
  • It works perfectly fine for me trying on localhost. Can you do a

    tail -f /var/log/syslog | grep xinetd 
    

    while restarting the xinetd service? Also try running nc on the same host where you have xinetd and see if it works on localhost.

    0 讨论(0)
  • 2020-12-18 12:45
    service testservice
    {
        port            = 5900
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = root
        server          = /usr/bin/testscript.sh       
        server_args     = test
    } 
    

    You're right, I couldn't get yours to work. The above seemed to.

    Make sure that testscript.sh is set +x and at the top contains #!/bin/sh (in your example it does appear that way)

    0 讨论(0)
提交回复
热议问题