diff --git a/debian/control b/debian/control index d1fc34b..4f00178 100644 --- a/debian/control +++ b/debian/control @@ -75,6 +75,7 @@ Depends: libnginx-mod-http-geoip (= ${binary:Version}), libnginx-mod-stream (= ${binary:Version}), libnginx-mod-stream-geoip (= ${binary:Version}), nginx-common (= ${source:Version}), + iproute2, ${misc:Depends}, ${shlibs:Depends} Breaks: nginx (<< 1.4.5-1), @@ -150,6 +151,7 @@ Package: nginx-light Architecture: any Depends: libnginx-mod-http-echo (= ${binary:Version}), nginx-common (= ${source:Version}), + iproute2, ${misc:Depends}, ${shlibs:Depends} Breaks: nginx (<< 1.4.5-1) @@ -196,6 +198,7 @@ Depends: libnginx-mod-http-auth-pam (= ${binary:Version}), libnginx-mod-stream-geoip (= ${binary:Version}), libnginx-mod-stream-geoip2 (= ${binary:Version}), nginx-common (= ${source:Version}), + iproute2, ${misc:Depends}, ${shlibs:Depends} Breaks: nginx (<< 1.4.5-1) diff --git a/debian/nginx-core.postinst b/debian/nginx-core.postinst index 2a1730f..b43571a 100644 --- a/debian/nginx-core.postinst +++ b/debian/nginx-core.postinst @@ -24,7 +24,12 @@ if [ -x /etc/init.d/nginx ]; then invoke-rc.d nginx upgrade || invoke-rc.d nginx restart exit $? else - invoke-rc.d nginx start || exit $? + if [ -z "$(ss -nlt 'sport = 80' | grep -v ^State)" ]; then + invoke-rc.d nginx start || exit $? + else + echo "Not attempting to start NGINX, port 80 is already in use." + exit 0 + fi fi fi diff --git a/debian/nginx-extras.postinst b/debian/nginx-extras.postinst index 2a1730f..b43571a 100644 --- a/debian/nginx-extras.postinst +++ b/debian/nginx-extras.postinst @@ -24,7 +24,12 @@ if [ -x /etc/init.d/nginx ]; then invoke-rc.d nginx upgrade || invoke-rc.d nginx restart exit $? else - invoke-rc.d nginx start || exit $? + if [ -z "$(ss -nlt 'sport = 80' | grep -v ^State)" ]; then + invoke-rc.d nginx start || exit $? + else + echo "Not attempting to start NGINX, port 80 is already in use." + exit 0 + fi fi fi diff --git a/debian/nginx-light.postinst b/debian/nginx-light.postinst index 2a1730f..b43571a 100644 --- a/debian/nginx-light.postinst +++ b/debian/nginx-light.postinst @@ -24,7 +24,12 @@ if [ -x /etc/init.d/nginx ]; then invoke-rc.d nginx upgrade || invoke-rc.d nginx restart exit $? else - invoke-rc.d nginx start || exit $? + if [ -z "$(ss -nlt 'sport = 80' | grep -v ^State)" ]; then + invoke-rc.d nginx start || exit $? + else + echo "Not attempting to start NGINX, port 80 is already in use." + exit 0 + fi fi fi