Executing script on receiving incoming connection with xinetd

后端 未结 2 1085
面向向阳花
面向向阳花 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条回答
  •  刺人心
    刺人心 (楼主)
    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)

提交回复
热议问题