1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Starting sidekiq via Capistrano requires a tty and nohup.

This commit is contained in:
Rob Chekaluk 2013-12-30 08:44:55 -05:00
parent a67f8427ac
commit 3e9d40c2e0

View file

@ -159,7 +159,8 @@ if [ -d $APP_ROOT ]; then
fi
fi
if [ ! -f $PID_FILE ]; then
sudo -u $USER -H -i sh -c "cd $APP_ROOT; $COMMAND" >> $LOG_FILE 2>&1 &
# http://maymay.net/blog/2010/03/17/how-to-work-around-sorry-you-must-have-a-tty-to-run-sudo-without-sacrificing-security/
nohup su - --session-command="cd $APP_ROOT; $COMMAND" $USER >> $LOG_FILE 2>&1 &
RESULT=$?
logger -t "monit-sidekiq[$$]" "Started with pid $! and exit $RESULT"
echo $! > $PID_FILE