#more nginx-fcgi
#!/bin/sh
#create by mahenglong
nginxroot=/usr/local/nginx
start ()
{
chown nobody.root $nginxroot/logs
echo "$nginxroot/nginx-fcgi.pl -l $nginxroot/logs/nginx-fcgi.log -pid $nginxroot/logs/nginx-fcgi.pid -s $nginxroot/logs/nginx-fcgi.sock" >> $nginxroot/nginx_fcgi.sh
chown nobody.nobody $nginxroot/nginx_fcgi.sh
chmod 755 $nginxroot/nginx_fcgi.sh
sudo -u nobody $nginxroot/nginx_fcgi.sh
echo "start nginx-fcgi done"
}
stop ()
{
kill $(cat $nginxroot/logs/nginx-fcgi.pid)
rm $nginxroot/logs/nginx-fcgi.pid 2>/dev/null
rm $nginxroot/logs/nginx-fcgi.sock 2>/dev/null
rm $nginxroot/nginx_fcgi.sh 2>/dev/null
echo "stop nginx-fcgi done"
}
case $1 in
stop)
stop
;;
start)
start
;;
restart)
stop
start
;;
*)
echo $"Usage: perl-cgi {start|stop|restart}"
exit 1
esac