Comment 4 for bug 1782226

Revision history for this message
Simon Déziel (sdeziel) wrote : Re: Allow NGINX to install but not start during postinst if another process is bound to port 80

I have not looked at the detection code but it might be possible to use "ss" instead of lsof to detect if anything listens on a given port. "ss" comes from iproute2 so it's more widely available.

  $ ss -nto state listening 'sport = 80'
  Recv-Q Send-Q Local Address:Port Peer Address:Port
  0 0 *:80 *:*
  0 0 :::80 :::*

I tried suppressing the header with "-H/--no-header" but ss segfaults but that's for another LP :)