nginx.paketlendi

This commit is contained in:
milisarge 2017-04-25 20:29:54 +03:00
parent 7b8312c9a5
commit 59412a11f7
5 changed files with 112 additions and 75 deletions

View File

@ -1,7 +1,7 @@
id www 2>/dev/null id www 2>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "User www already exit" echo "www kullanicisi zaten tanimli"
else else
echo "User www created" echo "www kullanicisi olusturuldu"
useradd -M -s /bin/false -c "www user" www useradd -M -s /bin/false -c "www user" www
fi fi

View File

@ -1,15 +1,14 @@
/var/log/nginx/*.log { /var/log/nginx/*.log {
su @USER@ @GROUP@ su @USER@ @GROUP@
daily daily
missingok missingok
rotate 52 rotate 52
compress compress
delaycompress delaycompress
notifempty notifempty
create 640 nginx adm create 640 nginx adm
sharedscripts sharedscripts
postrotate postrotate
[ -f /var/run/nginx.pid ] && \ [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
kill -USR1 `cat /var/run/nginx.pid` endscript
endscript
} }

View File

@ -1,55 +0,0 @@
#!/bin/sh
########################################################################
# Begin nginx.service
#
# Description : nginx init script
#
# Author : alienus at nutyx dot org
#
# Version : LFS 7.5
#
# Notes : NuTyX saravane
#
########################################################################
### BEGIN INIT INFO
# Provides: nginx init script
# Required-Start:
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start, stop and restart the nginx server
# Description:
# X-LFS-Provided-By:
### END INIT INFO
. /lib/lsb/init-functions
case "${1}" in
start)
log_info_msg "Starting..."
start_daemon /usr/sbin/nginx # fully_qualified_path
;;
stop)
log_info_msg "Stopping..."
killproc /usr/sbin/nginx # fully_qualified_path
;;
restart)
${0} stop
sleep 1
${0} start
;;
*)
echo "Usage: ${0} {start|stop|restart}"
exit 1
;;
esac
exit 0
# End scriptname

View File

@ -0,0 +1,93 @@
#!/bin/sh
#
# Nginx daemon control script.
# Written for Slackware Linux by Cherife Li <cherife-#-dotimes.com>.
BIN=/usr/sbin/nginx
CONF=/etc/nginx/nginx.conf
PID=/var/run/nginx.pid
nginx_start() {
# Sanity checks.
if [ ! -r $CONF ]; then # no config file, exit:
echo "$CONF dosyasi yok.iptal edildi."
exit 1
fi
if [ -s $PID ]; then
echo "Nginx zaten calisiyor?"
exit 1
fi
echo "Nginx baslatiliyor..."
if [ -x $BIN ]; then
$BIN -c $CONF
fi
}
nginx_test_conf() {
echo "Nginx ayarlari kontrol ediliyor..."
$BIN -t -c $CONF
}
nginx_term() {
echo "Nginx hizlica kapatiliyor..."
kill -TERM $(cat $PID)
}
nginx_stop() {
echo "Nginx kapatiliyor..."
kill -QUIT $(cat $PID)
}
nginx_reload() {
echo "Nginx ayarları yeniden yukleniyor..."
kill -HUP $(cat $PID)
}
nginx_upgrade() {
echo "Nginx ikili dosyası üst sürüme geciriliyor."
kill -USR2 $(cat $PID)
sleep 3
kill -QUIT $(cat $PID.oldbin)
}
nginx_rotate() {
echo "Nginx kayitlari ayarlaniyor..."
kill -USR1 $(cat $PID)
}
nginx_restart() {
nginx_stop
sleep 3
nginx_start
}
case "$1" in
check)
nginx_test_conf
;;
start)
nginx_start
;;
term)
nginx_term
;;
stop)
nginx_stop
;;
reload)
nginx_reload
;;
restart)
nginx_restart
;;
upgrade)
nginx_upgrade
;;
rotate)
nginx_rotate
;;
*)
echo "usage: `basename $0` {check|start|term|stop|reload|restart|upgrade|rotate}"
esac

View File

@ -4,17 +4,17 @@
# Depends on: libxml2 libxslt pcre # Depends on: libxml2 libxslt pcre
name=nginx name=nginx
version=1.6.2 version=1.11.13
release=2 release=1
source=(http://nginx.org//download/$name-$version.tar.gz source=(http://nginx.org//download/$name-$version.tar.gz
nginx.service nginx.servis
nginx.logrotate) nginx.logrotate)
# change those if you prefer another setup # change those if you prefer another setup
NGINXUSER=www NGINXUSER=www
NGINXGROUP=www NGINXGROUP=www
HTMLDIR=/srv/http # be aware that apache use /srv/www HTMLDIR=/srv/http/nginx
# change those if you need those experimental modules # change those if you need those experimental modules
# (idea from slackbuilds.org) # (idea from slackbuilds.org)
@ -88,7 +88,7 @@ build() {
-e '$s|.*| include /etc/nginx/conf.d/\*.conf;\n&|' \ -e '$s|.*| include /etc/nginx/conf.d/\*.conf;\n&|' \
$PKG/etc/nginx/$name.conf $PKG/etc/nginx/$name.conf
# install the nginx init script # install the nginx init script
install -Dm755 $SRC/nginx.service $PKG/etc/rc.d/init.d/nginx install -Dm755 $SRC/nginx.servis $PKG/etc/rc.d/init.d/nginx
# install the logrotate file # install the logrotate file
install -Dm644 $SRC/nginx.logrotate $PKG/etc/logrotate.d/nginx install -Dm644 $SRC/nginx.logrotate $PKG/etc/logrotate.d/nginx
# fill the right user & group in the logrotate file # fill the right user & group in the logrotate file