Skip to content

Instantly share code, notes, and snippets.

@eliotsykes
Created June 17, 2012 11:00
Show Gist options
  • Save eliotsykes/2944202 to your computer and use it in GitHub Desktop.
Save eliotsykes/2944202 to your computer and use it in GitHub Desktop.
Robust Thin restart|start|stop script for HTTP and SSL in development
#! /bin/bash
# restart will start thin without error even when it is not already running.
echo "Usage: ./script/thin start|stop|restart"
# Log and pid file names will include port number before the .log/.pid extension.
bundle exec thin --pid tmp/pids/thin.pid --servers 1 --daemonize --log log/thin.log --port 3000 $1
bundle exec thin --pid tmp/pids/thin.pid --servers 1 --daemonize --log log/thin.log --port 3001 --ssl $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment