Permalink
Browse files

improve quoting and detecting handling root in unicorn init.d script

  • Loading branch information...
1 parent e9af93a commit 475dd8e6d57409dc514dfc95a08325f60f9e5323 @mpapis mpapis committed Sep 24, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 contrib/unicorn_init.sh
@@ -85,7 +85,7 @@ prefix_command_with_su_fix_quoting()
__temp+=( "'$1'" )
shift
done
- CMD=( su - "${__owner}" -c "${__temp[*]}" )
+ CMD=( su - "${__owner}" -c "cd '$RAILS_ROOT' && ${__temp[*]}" )
}
setup ()
@@ -118,7 +118,7 @@ cmd_start()
{
if sig 0
then echo "Already started"
- else run "Starting" ${CMD[@]} || return $?
+ else run "Starting" "${CMD[@]}" || return $?
fi
}

0 comments on commit 475dd8e

Please sign in to comment.