Created
September 2, 2010 06:43
-
-
Save nijitaro/561969 to your computer and use it in GitHub Desktop.
CentOS startup script for the nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CentOS startup script for the nginx | |
* nginx installed /usr/local/nginx/ directory | |
$ sudo mv /path/to/nginxd /etc/init.d/nginxd | |
$ cd nginxd | |
$ chmod +x nginxd | |
$ chkconfig nginxd on | |
$ chkconfig --list nginxd | |
nginxd 0:off 1:off 2:on 3:on 4:on 5:on 6:off | |
Then, you can use it: /etc/init.d/nginx stop/start/restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Startup script for the nginx | |
# | |
# chkconfig: 345 80 15 | |
# description: Nginx web server. | |
# Source function library. | |
. /etc/rc.d/init.d/functions | |
start(){ | |
/usr/local/nginx/sbin/nginx | |
} | |
stop(){ | |
kill `cat /usr/local/nginx/logs/nginx.pid` | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment