Dipali Barapatre
2012-Oct-03 07:48 UTC
[Mongrel] Mongrel restart script in .sh file is not working
When I run script to restart mongrel written in .sh file , It is not working properly. Below are the commands written in .sh file. cd /home/apps/stage/bd/log && rm mongrel.pid -f pkill -9 mongrel_rails -u bandega cd /home/apps/stage/bd && mongrel_rails start -e production -p 4184 -d But when I manually run all above commands one by one on terminal, It is working properly and server is started properly. Is there are some problems while running script in .sh file? Thanks in advance. -- Posted via http://www.ruby-forum.com/.
John Weir
2012-Oct-03 13:51 UTC
[Mongrel] Mongrel restart script in .sh file is not working
try breaking your script down into multiple lines and not using the && operator it looks like there are some spots in the shell script where there should be a break, such as between the ''rm'', ''pkill'' and the ''cd'' On Oct 3, 2012, at 3:48 AM, Dipali Barapatre <lists at ruby-forum.com> wrote:> When I run script to restart mongrel written in .sh file , It is not > working properly. > > Below are the commands written in .sh file. > > cd /home/apps/stage/bd/log && rm mongrel.pid -f pkill -9 mongrel_rails > -u bandega cd /home/apps/stage/bd && mongrel_rails start -e production > -p 4184 -d > > But when I manually run all above commands one by one on terminal, It is > working properly and server is started properly. > > Is there are some problems while running script in .sh file? > > Thanks in advance. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >
John Weir
2012-Oct-03 13:52 UTC
[Mongrel] Mongrel restart script in .sh file is not working
> try breaking your script down into multiple lines and not using the && operatorand then add the && back in once you get the script working> it looks like there are some spots in the shell script where there should be a break, such as between the ''rm'', ''pkill'' and the ''cd'' > > On Oct 3, 2012, at 3:48 AM, Dipali Barapatre <lists at ruby-forum.com> wrote: > >> When I run script to restart mongrel written in .sh file , It is not >> working properly. >> >> Below are the commands written in .sh file. >> >> cd /home/apps/stage/bd/log && rm mongrel.pid -f pkill -9 mongrel_rails >> -u bandega cd /home/apps/stage/bd && mongrel_rails start -e production >> -p 4184 -d >> >> But when I manually run all above commands one by one on terminal, It is >> working properly and server is started properly. >> >> Is there are some problems while running script in .sh file? >> >> Thanks in advance. >> >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users >> >