我有一个名为mgrst的脚本,为我重新启动杂种:
cd /opt/redmine /usr/local/bin/mongrel_rails cluster::stop rm -rf tmp/pids/* /usr/local/bin/mongrel_rails cluster::start
我用rc.local的一行来调用它:
/usr/bin/mgrst >>/tmp/start.log 2>&1
start.log在启动后有这个:
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在启动后不启动。 我可以切换到root并运行上面的mgrst命令,它工作正常。 从上面的错误看来,即使我给它一个完整的path,它不会在启动时findmongrel命令。 任何想法发生了什么?
是否有可能是相对调用custom_require.rb中的某些内容,但是由于您是从rc.local运行的,因此没有定义的(或者至less没有正确定义的)$ PATH,而当您loginbash(或任何shell)时你的path,然后运行良好?
我认为这个问题是在错误行上描述的:尝试使参数-P和-l成为绝对path。