aboutsummaryrefslogtreecommitdiffstats
path: root/testing/nginx-naxsi/nginx.initd
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2017-03-17 21:18:20 +0000
committerJakub Jirutka <jakub@jirutka.cz>2017-03-21 12:59:42 +0100
commit89e1b4d9204770c581b0c02bf71d1ba6b70e1778 (patch)
tree41f2a467a13aeb5d7ea9671b1ee854f782c6c509 /testing/nginx-naxsi/nginx.initd
parentf54320b1b9d7fdd21776978a192b85b04079ad2f (diff)
downloadaports-89e1b4d9204770c581b0c02bf71d1ba6b70e1778.tar.bz2
aports-89e1b4d9204770c581b0c02bf71d1ba6b70e1778.tar.xz
testing/nginx-naxsi: => 1.11.10 / naxsi 0.55.3 / use supervise-daemon
* initd now uses supervise-daemon for service supervision * removes duplicate --with-http_realip_module * removes scgi_params & uwsgi_params as the servers are disabled
Diffstat (limited to 'testing/nginx-naxsi/nginx.initd')
-rw-r--r--testing/nginx-naxsi/nginx.initd43
1 files changed, 12 insertions, 31 deletions
diff --git a/testing/nginx-naxsi/nginx.initd b/testing/nginx-naxsi/nginx.initd
index 9e51e7dfa3..44c9033b70 100644
--- a/testing/nginx-naxsi/nginx.initd
+++ b/testing/nginx-naxsi/nginx.initd
@@ -1,12 +1,14 @@
#!/sbin/openrc-run
+supervisor=supervise-daemon
description="Nginx http and reverse proxy server"
extra_started_commands="reload reopen upgrade"
cfgfile=${cfgfile:-/etc/nginx/nginx.conf}
-pidfile=/run/nginx/nginx.pid
+pidfile=/run/nginx/$RC_SVCNAME.sd.pid
command=/usr/sbin/nginx
command_args="-c $cfgfile"
+command_args_foreground='-g "daemon off;"'
required_files="$cfgfile"
depend() {
@@ -23,45 +25,24 @@ start_pre() {
reload() {
ebegin "Reloading ${SVCNAME} configuration"
- start_pre && start-stop-daemon --signal HUP --pidfile $pidfile
+ start_pre && $command -s reload
eend $?
}
reopen() {
ebegin "Reopening ${SVCNAME} log files"
- start-stop-daemon --signal USR1 --pidfile $pidfile
+ $command -s reopen
eend $?
}
upgrade() {
- start_pre || return 1
-
- ebegin "Upgrading ${SVCNAME} binary"
-
- einfo "Sending USR2 to old binary"
- start-stop-daemon --signal USR2 --pidfile $pidfile
-
- einfo "Sleeping 3 seconds before pid-files checking"
- sleep 3
-
- if [ ! -f $pidfile.oldbin ]; then
- eerror "File with old pid ($pidfile.oldbin) not found"
- return 1
- fi
-
- if [ ! -f $pidfile ]; then
- eerror "New binary failed to start"
- return 1
- fi
-
- einfo "Sleeping 3 seconds before WINCH"
- sleep 3 ; start-stop-daemon --signal 28 --pidfile $pidfile.oldbin
-
- einfo "Sending QUIT to old binary"
- start-stop-daemon --signal QUIT --pidfile $pidfile.oldbin
-
- einfo "Upgrade completed"
+ restart
+}
- eend $? "Upgrade failed"
+restart() {
+ stop
+ # prevents bind() failed (98: Address in use) error msg
+ sleep 0.05
+ start
}