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

Use sudo -i switch (simulate initial login) incorporates RVM environment when using RVM. Also chdir into the proper directory since this switch implies using the user home directory.

This commit is contained in:
Rob Chekaluk 2013-12-26 13:12:25 -05:00
parent fee3301ac3
commit 7932d455f1

View file

@ -158,7 +158,7 @@ if [ -d $APP_ROOT ]; then
fi
fi
if [ ! -f $PID_FILE ]; then
sudo -u $USER -H $COMMAND >> $LOG_FILE 2>&1 &
sudo -u $USER -H -i sh -c "cd $APP_ROOT; $COMMAND" >> $LOG_FILE 2>&1 &
RESULT=$?
logger -t "monit-sidekiq[$$]" "Started with pid $! and exit $RESULT"
echo $! > $PID_FILE