Created
November 10, 2011 16:16
-
-
Save fabriziomachado/1355256 to your computer and use it in GitHub Desktop.
/etc/init.d/gearman-workers
This file contains hidden or 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 | |
# | |
# /etc/init.d/gearman-workers | |
#count="ps x -o pid,command | sed -n \"s/^ *\([0-9]*\) .*worker\.php.*/\1/p\" | wc -l" | |
#echo $count | |
case "$1" in | |
start) | |
# comando para iniciar o serviço | |
echo "Starting workers..." | |
for worker_id in {1..5} | |
do | |
echo "worker $2 with id $worker_id started" | |
php /home/fabrizio/public_html/dev.localhost/codeigniter-academic/application/workers/$2 & | |
done | |
echo "Ok.." | |
exit 1 | |
;; | |
stop) | |
echo "Stoping workers $2" | |
# comando para parar o serviço | |
sudo /etc/init.d/pskiller.sh $2 | |
exit 1 | |
;; | |
restart) | |
echo "Restart..." | |
# comando para reiniciar o serviço | |
;; | |
*) | |
echo "Input start or stop" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment