diff options
author | Valery Kartel <valery.kartel@gmail.com> | 2017-03-17 12:05:44 +0200 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2017-03-17 10:29:51 +0000 |
commit | e07695e1581744e63bd459f7fa827f51c4d8dbf7 (patch) | |
tree | 1ed3e7b5d9f9187a0fd195993eb1a1f69b864292 /main/nginx/nginx.initd | |
parent | 3c979daea8b4edb2efde9199fe3ef7b4bb31f916 (diff) | |
download | aports-e07695e1581744e63bd459f7fa827f51c4d8dbf7.tar.bz2 aports-e07695e1581744e63bd459f7fa827f51c4d8dbf7.tar.xz |
main/nginx: add all modules from testing/nginx-naxsi
- added modules: naxsi, cache_purge, upstream-fair, sysguard
- remade dynamic modules definition
- upgrade modules
nchan to 1.1.2
rtmp to 1.1.11
naxsi to 0.55.3
- add checkconfig to init script
- cleaned and improved APKBUILD
Diffstat (limited to 'main/nginx/nginx.initd')
-rw-r--r-- | main/nginx/nginx.initd | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/main/nginx/nginx.initd b/main/nginx/nginx.initd index 992d5fd5b9..d01874e4f4 100644 --- a/main/nginx/nginx.initd +++ b/main/nginx/nginx.initd @@ -1,9 +1,15 @@ #!/sbin/openrc-run description="Nginx http and reverse proxy server" +description_checkconfig="Verify configuration" +description_upgrade="Upgrade running binary" +description_reload="Reload configuration" +description_reopen="Reopen log files" + +extra_commands="checkconfig" extra_started_commands="reload reopen upgrade" -cfgfile=${cfgfile:-/etc/nginx/nginx.conf} +cfgfile=${NGINX_CONFIG:-/etc/nginx/nginx.conf} pidfile=/run/nginx/nginx.pid command=/usr/sbin/nginx command_args="-c $cfgfile" @@ -14,29 +20,35 @@ depend() { use dns logger netmount } +checkconfig() { + ebegin "Checking $RC_SVCNAME config" + $command $command_args -t + eend $? +} + start_pre() { ebegin - checkpath --directory --owner nginx:nginx ${pidfile%/*} - $command $command_args -t -q + checkpath -d -o ${NGINX_OWNER:-nginx:nginx} ${pidfile%/*} + checkconfig >/dev/null 2>&1 eend $? } reload() { - ebegin "Reloading ${SVCNAME} configuration" - start_pre && start-stop-daemon --signal HUP --pidfile $pidfile + ebegin "Reloading $RC_SVCNAME configuration" + checkconfig >/dev/null 2>&1 && start-stop-daemon --signal HUP --pidfile $pidfile eend $? } reopen() { - ebegin "Reopening ${SVCNAME} log files" + ebegin "Reopening $RC_SVCNAME log files" start-stop-daemon --signal USR1 --pidfile $pidfile eend $? } upgrade() { - start_pre || return 1 + checkconfig || return $? - ebegin "Upgrading ${SVCNAME} binary" + ebegin "Upgrading $RC_SVCNAME binary" einfo "Sending USR2 to old binary" start-stop-daemon --signal USR2 --pidfile $pidfile |