Skip to content

Instantly share code, notes, and snippets.

@svoboda-jan
Created June 29, 2016 18:21
Show Gist options
  • Save svoboda-jan/873f41c5d58f8b87b49addec43135b74 to your computer and use it in GitHub Desktop.
Save svoboda-jan/873f41c5d58f8b87b49addec43135b74 to your computer and use it in GitHub Desktop.
Updated heler script for Puma init script for Debian 8.5
#!/bin/bash
# on system boot, and root have no rbenv installed,
# after start-stop-daemon switched to current user, we have to init rbenv
if [ -d "$HOME/.rbenv/bin" ]; then
PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
eval "$(rbenv init -)"
elif [ -d "/usr/local/rbenv/bin" ]; then
PATH="/usr/local/rbenv/bin:/usr/local/rbenv/shims:$PATH"
eval "$(rbenv init -)"
fi
app=$1; config=$2; log=$3;
cd $app && exec bundle exec puma -C $config 2>&1 >> $log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment