in Профессиональное

Init скрипт для nginx

Вот ломает меня ручками управлять nginx. Хотелось init скрипт. Нагуглил такой вот (работает, не жалуюсь):

#!/bin/sh
# Init file for nginx server daemon
# chkconfig: - 85 15
# description: nginx server daemon
bin=/sbin/nginx
pid_file=/usr/local/nginx/nginx.pid
case "$1" in
start)
echo -n "Starting nginx: "
$bin && echo OK || echo FAILED
;;
stop)
echo -n "Stopping nginx: "
kill `cat $pid_file` && echo OK || echo FAILED
;;
configtest)
$bin -t
;;
reload)
echo -n "Reloading nginx: "
kill -HUP `cat $pid_file` && echo OK || echo FAILED
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart|reload|configtest}"
exit 1
;;
esac

Write a Comment

Comment

ERROR: si-captcha.php plugin: GD image support not detected in PHP!

Contact your web host and ask them to enable GD image support for PHP.

ERROR: si-captcha.php plugin: imagepng function not detected in PHP!

Contact your web host and ask them to enable imagepng for PHP.