Created
August 3, 2009 14:54
-
-
Save riffm/160600 to your computer and use it in GitHub Desktop.
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/sh | |
# Script for starting multiple fcgi instance. | |
# Count of instances is first argument of script. | |
PARAMS="runfcgi method=threaded daemonize=yes errlog=errlog.log workdir=./" | |
case $2 in | |
"start") | |
if [ $1 -le 1 ] | |
then | |
echo Please provide count of fcgi instances | |
exit 1 | |
fi | |
for inst in $(seq $1) | |
do | |
python ./manage.py $PARAMS socket=instance$inst.sock pidfile=instance$inst.pid | |
done | |
;; | |
"stop") | |
for inst in $(ls *.pid) | |
do | |
kill $(cat $inst) | |
rm ./$inst | |
done | |
for inst in $(ls *.sock) | |
do | |
rm ./$inst | |
done | |
;; | |
*) | |
echo Usage instance_count \(start\|stop\) | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment