Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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?

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.