Linux Nginx startup script

Source: Internet
Author: User

Linux Nginx startup script

[Email protected] ~]#VI/etc/init.d/nginx#!/bin/bash# nginx Startup script forThe Nginx HTTP server# This script to create it by Jackbillow at2007.10. the. # It is v.0.0.2version.#ifYouFindAny errors-scripts,please contact jackbillow.# and send mail to jackbillow at gmail Dot com.## chkconfig: - -  the# Description:nginx is a high-performance Web and proxy server.# It has a lot of features, but it's not for everyone.# processname:nginx# Pidfile:/var/run/nginx.pid# config:/usr/local/nginx/conf/Nginx.confnginxd=/usr/local/nginx/sbin/Nginxnginx_config=/usr/local/nginx/conf/Nginx.confnginx_pid=/var/run/Nginx.pidretval=0Prog="Nginx"# SourcefunctionLibrary:/etc/rc.d/init.d/functions# Source Networking configuration:/etc/sysconfig/network# Check, Networking is up.#[${networking}="No"] && exit0[ -X $nginxd] | | Exit0# Start Nginx daemons Functions.start () {if[-e $nginx _pid]; Then   Echo "Nginx already running ...."Exit1fi   Echo-N $"starting $prog:"Daemon $nginxd-c ${nginx_config} RETVAL=$?Echo[$RETVAL=0] &&Touch/var/lock/subsys/nginx return $RETVAL}# Stop nginx daemons functions.stop () {Echo-N $"stopping $prog:"Killproc $nginxd RETVAL=$?Echo[$RETVAL=0] &&RM-f/var/lock/subsys/nginx/var/run/nginx.pid}# Reload Nginx Service Functions.reload () {Echo-N $"Reloading $prog:"    #Kill-hup 'Cat${nginx_pid} ' Killproc $nginxd-HUP RETVAL=$?Echo}# See how we were called. Case " $" inchstart) Start; stop) stop;; reload) reload;; restart) stop start;; Status) status $prog RETVAL=$?        ;;*)        Echo$"Usage: $prog {start|stop|restart|reload|status|help}"Exit1EsacExit $RETVAL

.

Linux Nginx startup script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.