Forum: Mongrel Mongrel restart script in .sh file is not working

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2716961649ab0d3854586dfea0bba22d?d=identicon&s=25 Dipali Barapatre (dipali)
on 2012-10-03 09:48
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.
15cf2f1fa9ef1e1e63a7baa03477b8b5?d=identicon&s=25 John Private (smokinggun)
on 2012-10-03 16:24
(Received via mailing list)
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'
15cf2f1fa9ef1e1e63a7baa03477b8b5?d=identicon&s=25 John Private (smokinggun)
on 2012-10-03 16:30
(Received via mailing list)
> try breaking your script down into multiple lines and not using the && operator

and then add the && back in once you get the script working
This topic is locked and can not be replied to.