Skip to content

Commit

Permalink
Use sudo -i switch (simulate initial login) incorporates RVM environm…
Browse files Browse the repository at this point in the history
…ent when using RVM. Also chdir into the proper directory since this switch implies using the user home directory.
  • Loading branch information
Rob Chekaluk committed Dec 26, 2013
1 parent fee3301 commit 7932d45
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7932d45

Please sign in to comment.