xInetd connections and port

2008-03-26
2012-12-29
  • I successfully convert my service to run using xinetd on linux. However I still have one very minor hole. Is there a way the process can determine what port it was launched from?

    Thanks,

    Jerry Goodnough

     
    • Sam Weiner
      Sam Weiner
      2008-03-26

      If you do a ZSHOW "D":lv and look at the entry
      for the socket named 0, one of the fields is
      LOCAL=<ipaddr>@<port>.  For example:

      0 OPEN SOCKET TOTAL=1 CURRENT=0
              SOCKET[0]=h11967307790 DESC=0 CONNECTED ACTIVE  TRAP  REMOTE=99.999.99.99@35606
              LOCAL=99.999.999.999@7777

      In this case, xinetd was listening on port 7777.

      Sam