summaryrefslogtreecommitdiff
path: root/community-testing
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-06-25 00:01:42 +0000
committerroot <root@rshg054.dnsready.net>2012-06-25 00:01:42 +0000
commit3b99c42eb8ca744e86e4e17197b1bf10642c6785 (patch)
tree32a8e3b87b35056995f805dec0e5a108425354c7 /community-testing
parent4319f36e44d4e7c70bf010c3286bb1739c59d4de (diff)
Mon Jun 25 00:01:41 UTC 2012
Diffstat (limited to 'community-testing')
-rw-r--r--community-testing/nginx/PKGBUILD10
-rw-r--r--community-testing/nginx/nginx.install10
-rw-r--r--community-testing/nginx/rc.d68
-rw-r--r--community-testing/nginx/service13
4 files changed, 93 insertions, 8 deletions
diff --git a/community-testing/nginx/PKGBUILD b/community-testing/nginx/PKGBUILD
index 7d95b3070..508861959 100644
--- a/community-testing/nginx/PKGBUILD
+++ b/community-testing/nginx/PKGBUILD
@@ -1,11 +1,11 @@
-# $Id: PKGBUILD 72598 2012-06-17 09:51:17Z bpiotrowski $
+# $Id: PKGBUILD 72828 2012-06-23 06:49:26Z bpiotrowski $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Bartłomiej Piotrowski <barthalion@gmal.com>
# Contributor: Miroslaw Szot <mss@czlug.icis.pcz.pl>
pkgname=nginx
pkgver=1.2.1
-pkgrel=4
+pkgrel=6
pkgdesc="lightweight HTTP server and IMAP/POP3 proxy server"
arch=('i686' 'x86_64')
depends=('pcre' 'zlib' 'openssl')
@@ -25,10 +25,11 @@ backup=('etc/nginx/fastcgi.conf'
'etc/nginx/win-utf'
'etc/logrotate.d/nginx')
source=(http://nginx.org/download/nginx-$pkgver.tar.gz
- nginx
+ rc.d service
nginx.logrotate)
md5sums=('ceacae12d66d1f021bf3737a0269b6f4'
'f62c7c9b5a53471d4666a4c49ad363fb'
+ '16c6b4cbe24001a3f4f58b9d5f4e3d4c'
'b38744739022876554a0444d92e6603b')
_cfgdir=/etc/nginx
@@ -95,7 +96,8 @@ package() {
install -d $pkgdir/usr/share/nginx
mv $pkgdir/etc/nginx/html/ $pkgdir/usr/share/nginx
- install -D -m755 $srcdir/nginx $pkgdir/etc/rc.d/nginx
+ install -D -m755 $srcdir/rc.d $pkgdir/etc/rc.d/nginx
+ install -Dm644 $srcdir/service $pkgdir/usr/lib/systemd/system/nginx.service
install -D -m644 LICENSE $pkgdir/usr/share/licenses/nginx/LICENSE
rm -rf $pkgdir/var/run
}
diff --git a/community-testing/nginx/nginx.install b/community-testing/nginx/nginx.install
index cdad14f43..b31ee41d7 100644
--- a/community-testing/nginx/nginx.install
+++ b/community-testing/nginx/nginx.install
@@ -1,9 +1,11 @@
post_upgrade() {
+ if [[ $(vercmp $2 1.2.1-2) -le 0 ]]; then
echo " >>> Since 1.2.1-2 several changes has been made in package:"
- echo " - *.conf files has been moved to /etc/nginx"
+ echo " - *.conf files have been moved to /etc/nginx"
echo " - /etc/conf.d/nginx has been removed"
- echo " Main configuration files is set to /etc/nginx/nginx.conf"
- echo " - access.log and error.log can be found in /var/log/nginx at default"
- echo " - bundled *.html files has been moved to /usr/share/nginx/html"
+ echo " Main configuration file is set to /etc/nginx/nginx.conf"
+ echo " - access.log and error.log can be found in /var/log/nginx by default"
+ echo " - bundled *.html files have been moved to /usr/share/nginx/html"
echo " - /etc/nginx/{html,logs} symbolic links and *.default files have been removed"
+ fi
}
diff --git a/community-testing/nginx/rc.d b/community-testing/nginx/rc.d
new file mode 100644
index 000000000..eb9031e81
--- /dev/null
+++ b/community-testing/nginx/rc.d
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+function check_config {
+ stat_busy "Checking nginx configuration"
+ /usr/sbin/nginx -t -q -c /etc/nginx/nginx.conf
+ if [ $? -ne 0 ]; then
+ stat_die
+ else
+ stat_done
+ fi
+}
+
+case "$1" in
+ start)
+ check_config
+ $0 careless_start
+ ;;
+ careless_start)
+ stat_busy "Starting nginx"
+ if [ -s /var/run/nginx.pid ]; then
+ stat_fail
+ # probably ;)
+ stat_busy "Nginx is already running"
+ stat_die
+ fi
+ /usr/sbin/nginx -c /etc/nginx/nginx.conf &>/dev/null
+ if [ $? -ne 0 ]; then
+ stat_fail
+ else
+ add_daemon nginx
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping nginx"
+ PID=$(cat /var/run/nginx.pid)
+ kill -QUIT $PID &>/dev/null
+ if [ $? -ne 0 ]; then
+ stat_fail
+ else
+ for i in {1..10}; do
+ [ -d /proc/$PID ] || { stat_done; rm_daemon nginx; exit 0; }
+ sleep 1
+ done
+ stat_fail
+ fi
+ ;;
+ restart)
+ check_config
+ $0 stop
+ sleep 1
+ $0 careless_start
+ ;;
+ reload)
+ check_config
+ if [ -s /var/run/nginx.pid ]; then
+ status "Reloading nginx configuration" kill -HUP $(cat /var/run/nginx.pid)
+ fi
+ ;;
+ check)
+ check_config
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart|reload|check|careless_start}"
+esac
diff --git a/community-testing/nginx/service b/community-testing/nginx/service
new file mode 100644
index 000000000..78d0a492c
--- /dev/null
+++ b/community-testing/nginx/service
@@ -0,0 +1,13 @@
+[Unit]
+Description=A high performance web server and a reverse proxy server
+
+[Service]
+Type=forking
+PIDFile=/run/nginx.pid
+ExecStartPre=/usr/sbin/nginx -t -q -g 'pid /run/nginx.pid; daemon on; master_process on;'
+ExecStart=/usr/sbin/nginx -g 'pid /run/nginx.pid; daemon on; master_process on;'
+ExecReload=/usr/sbin/nginx -g 'pid /run/nginx.pid; daemon on; master_process on;' -s reload
+ExecStop=/usr/sbin/nginx -g 'pid /run/nginx.pid;' -s quit
+
+[Install]
+WantedBy=multi-user.target