Skip to content

Instantly share code, notes, and snippets.

@Ttech
Created January 7, 2010 21:42
Show Gist options
  • Save Ttech/271600 to your computer and use it in GitHub Desktop.
Save Ttech/271600 to your computer and use it in GitHub Desktop.
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
$spawncgi=/usr/bin/spawn-fcgi
$daemon_name = php-cgi
ARGS=-" -a 127.0.0.1 -p 9000 -f /usr/bin/php-cgi -U http"
case "$1" in
start)
stat_busy "Starting Fast CGI Daemon"
if $spawncgi $ARGS &>/dev/null ; then
add_daemon $daemon_name
stat_done
else
stat_fail
exit 1
fi
;;
;;
stop)
stat_busy "Stopping Fast CGI Daemon"
if killall -9 $daemon_name &>/dev/null ; then
rm_daemon $daemon_name
stat_done
else
stat_fail
exit 1
fi
;;
restart)
if killall -9 $daemon_name &>/dev/null ; then
add_daemon $daemon_name
stat_done
else
stat_fail
exit 1
fi
;;
status)
stat_busy "Checking "Fast CGI Daemon Status";
ck_status $daemon_name
;;
*)
echo "Usage: fcgi {start|stop|restart}"
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment