Check if port 80 is free before starting during install
This commit is contained in:
parent
d9b51eb2ed
commit
cc65b80eb0
4 changed files with 21 additions and 3 deletions
3
debian/control
vendored
3
debian/control
vendored
|
|
@ -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)
|
||||
|
|
|
|||
7
debian/nginx-core.postinst
vendored
7
debian/nginx-core.postinst
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
7
debian/nginx-extras.postinst
vendored
7
debian/nginx-extras.postinst
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
7
debian/nginx-light.postinst
vendored
7
debian/nginx-light.postinst
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue