capistrano-plugins / capistrano-unicorn-nginx

Capistrano tasks for automatic and sensible unicorn + nginx configuration
MIT License
175 stars 81 forks source link

What's the meaning of `set -e` and `set -u` #71

Closed ghost closed 9 years ago

ghost commented 9 years ago

tmplates/unicorn_init.erb:

### END INIT INFO
set -e

# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=<%= current_path %>
PID=<%= fetch(:unicorn_pid) %>

# no rvm and no rbenv
CMD="cd $APP_ROOT; bundle exec unicorn -D -c <%= fetch(:unicorn_config) %> -E <%= fetch(:rails_env) %>"

# rvm
#CMD="cd <%= current_path %>; <%= fetch(:rvm_path) %>/bin/rvm do bundle exec unicorn -D -c <%= fetch(:unicorn_config) %> -E <%= fetch(:rails_env) %>"

# rbenv TODO
# doesn't work CMD="cd <%= current_path %>; bundle exec unicorn -D -c <%= fetch(:unicorn_config) %> -E <%= fetch(:rails_env) %>"

AS_USER=<%= fetch(:unicorn_user) %>
set -u

what's the meaning of set -u and set -e?

rhomeister commented 9 years ago

Google is your friend: http://www.davidpashley.com/articles/writing-robust-shell-scripts/

If this is not a bug or feature request, please close this issue.

ghost commented 9 years ago

@rhomeister Thank you, I got it.