Skip to content

Instantly share code, notes, and snippets.

@MOZGIII
Last active March 20, 2016 16:13
Show Gist options
  • Save MOZGIII/4438209 to your computer and use it in GitHub Desktop.
Save MOZGIII/4438209 to your computer and use it in GitHub Desktop.
Start script for RVM + Thin + unix socket. Should be located in the project's root directory.
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
sudo -u www-data touch $DIR/tmp/sockets/thin.sock
rvmsudo -u www-data bundle exec thin start -C thin.yml --socket $DIR/tmp/sockets/thin.sock
#!/bin/bash
rvmsudo -u www-data bundle exec thin stop
@MOZGIII
Copy link
Author

MOZGIII commented Mar 20, 2016

This is outdated. I recommend using runit or systemd to manage these kinds of services. Both can work in unprivileged (non-root) mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment