Skip to content

Commit

Permalink
Merge pull request sidekiq#1424 from opengovernment/feature/generaliz…
Browse files Browse the repository at this point in the history
…ed-start-script

Starting sidekiq via Capistrano requires a tty and nohup.
  • Loading branch information
mperham committed Jan 10, 2014
2 parents 7e6929d + cac620e commit c95a6b1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c95a6b1

Please sign in to comment.