I am trying to figure out why my process doesn't work if started via a script, but works fine if started by hand.Here's the details:script is a resque worker start script. The script location is /etc/monit/conf.d/start_resque.sh. Permissions are 755 and owned by ubuntu:ubuntuWhen I run the script, the log output gets a pid and it says starting worker ip-xx-xxx-xxx-xx:26732 (or whatever the pid is), however when I ps aux | grep 26732, nothing is shown as running.  When I run the same exact command by hand in my rails project directory, the same starting worker output is displayed, and the process is actually started and continues to run.  One thing to note, additional output is displayed if started by hand: nohup: ignoring inputAnother question someone might be able to help with, is why does BACKGROUND=yes not actually daemonize my worker...thus I'm resorting to nohup, which seems to work fine.Here's my script (the command I run by hand is after the cd):#!/bin/bashecho starting worker..workercount=$(ps aux | grep -c resque)currentdir=/var/www/apps/myapp/currentlogdir=$currentdir/log/resque_worker.logpidfile=$currentdir/tmp/pids/resque_worker_$workercount.pidcd $currentdirnohup bundle exec rake environment resque:work RAILS_ENV=production QUEUE='*' VERBOSE=1 PIDFILE=$pidfile >> $logdir 2>&1 &echo started worker $workercount! view log at $logdir. view pidfile at $pidfileAdditional notes: on Ubuntu 12.04 and am connected via ssh while running both the script and the manual command.
Starting Resque worker with script doesnt work, starting by hand does
ubuntu;shell script;nohup