0

I have a script called mgrst that restarts mongrel for me:

cd /opt/redmine
/usr/local/bin/mongrel_rails cluster::stop
rm -rf tmp/pids/*
/usr/local/bin/mongrel_rails cluster::start

I am calling this with a line in rc.local:

/usr/bin/mgrst >>/tmp/start.log  2>&1

start.log has this in it after startup:

already stopped port 3000
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31: command not found: mongrel_rails start -d -e production -c /opt/redmine --user apache --group apache -p 3000 -P tmp/pids/mongrel.3000.pid -l log/mongrel.3000.log
starting port 3000

Mongrel is not started after startup. I can switch to root and run the mgrst command above and it works fine. From the error above it appears it's not finding the mongrel command at startup even though I give it a full path. Any idea what's going on here?

2 Answers 2

1

is it possible that something in custom_require.rb is being called relatively, but since you are running from rc.local there is no defined (or at least not properly defined) $PATH, versus when you log in bash (or whatever shell) sets your path and then it runs fine?

1

I think the problem is described on that error line: Try making the args to -P and -l be absolute paths.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .