From c06960a05ad9c0720cdc794da7436c4f8935e734 Mon Sep 17 00:00:00 2001 From: milisbir Date: Fri, 21 Jul 2017 20:44:45 +0300 Subject: [PATCH] mbd-nginx.eklendi --- ayarlar/servisler/Makefile | 20 ++++++ ayarlar/servisler/mbd/init.d/nginx | 102 +++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 ayarlar/servisler/mbd/init.d/nginx diff --git a/ayarlar/servisler/Makefile b/ayarlar/servisler/Makefile index 4eb9ecc85..a26139731 100644 --- a/ayarlar/servisler/Makefile +++ b/ayarlar/servisler/Makefile @@ -75,6 +75,16 @@ kur-hiawatha: dizinleri-olustur ln -sf ../init.d/hiawatha ${EXTDIR}/rc.d/rc4.d/S32hiawatha ln -sf ../init.d/hiawatha ${EXTDIR}/rc.d/rc5.d/S32hiawatha ln -sf ../init.d/hiawatha ${EXTDIR}/rc.d/rc6.d/K28hiawatha + +kur-nginx: dizinleri-olustur + install -m ${MODE} mbd/init.d/nginx ${EXTDIR}/rc.d/init.d/ + ln -sf ../init.d/nginx ${EXTDIR}/rc.d/rc0.d/K28nginx + ln -sf ../init.d/nginx ${EXTDIR}/rc.d/rc1.d/K28nginx + ln -sf ../init.d/nginx ${EXTDIR}/rc.d/rc2.d/K28nginx + ln -sf ../init.d/nginx ${EXTDIR}/rc.d/rc3.d/S32nginx + ln -sf ../init.d/nginx ${EXTDIR}/rc.d/rc4.d/S32nginx + ln -sf ../init.d/nginx ${EXTDIR}/rc.d/rc5.d/S32nginx + ln -sf ../init.d/nginx ${EXTDIR}/rc.d/rc6.d/K28nginx kur-php: dizinleri-olustur install -m ${MODE} mbd/init.d/php-fpm ${EXTDIR}/rc.d/init.d/ @@ -638,6 +648,16 @@ sil-hiawatha: rm -f ${EXTDIR}/rc.d/rc4.d/S32hiawatha rm -f ${EXTDIR}/rc.d/rc5.d/S32hiawatha rm -f ${EXTDIR}/rc.d/rc6.d/K28hiawatha + +sil-nginx: + rm -f ${EXTDIR}/rc.d/init.d/nginx + rm -f ${EXTDIR}/rc.d/rc0.d/K28nginx + rm -f ${EXTDIR}/rc.d/rc1.d/K28nginx + rm -f ${EXTDIR}/rc.d/rc2.d/K28nginx + rm -f ${EXTDIR}/rc.d/rc3.d/S32nginx + rm -f ${EXTDIR}/rc.d/rc4.d/S32nginx + rm -f ${EXTDIR}/rc.d/rc5.d/S32nginx + rm -f ${EXTDIR}/rc.d/rc6.d/K28nginx sil-php: rm -f ${EXTDIR}/rc.d/init.d/php-fpm diff --git a/ayarlar/servisler/mbd/init.d/nginx b/ayarlar/servisler/mbd/init.d/nginx new file mode 100644 index 000000000..8aa5ef3eb --- /dev/null +++ b/ayarlar/servisler/mbd/init.d/nginx @@ -0,0 +1,102 @@ +#!/bin/sh +# +# Nginx daemon control script. +# Written for Slackware Linux by Cherife Li . +# milisarge milisarge@gmail.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_winch() { + echo "Nginx eski süreçleri kapatıyor..." + kill -WINCH $(cat $PID.oldbin) +} + +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 + ;; + winch) + nginx_winch + ;; + restart) + nginx_restart + ;; + upgrade) + nginx_upgrade + ;; + rotate) + nginx_rotate + ;; + *) + echo "usage: `basename $0` {check|start|term|stop|winch|reload|restart|upgrade|rotate}" +esac