Skip to content

Instantly share code, notes, and snippets.

@biinari
Created June 12, 2013 15:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save biinari/5766564 to your computer and use it in GitHub Desktop.
Save biinari/5766564 to your computer and use it in GitHub Desktop.
Upstart script for http://mailcatcher.me/ /etc/init/mailcatcher.conf
description "Mailcatcher"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
pre-start script
bash << "EOF"
mkdir -p /var/log/mailcatcher
chown -R vagrant /var/log/mailcatcher
EOF
end script
exec su - vagrant -c 'mailcatcher --http-ip=0.0.0.0 &>>/var/log/mailcatcher/mailcatcher.log'
@astehlik
Copy link

Thank you for this script! One suggestion for improvement:

I use the -f flag and remove the ampersand &. This makes mailcatcher run in the foreground and upstart can detect if the service is running or not.

exec su - vagrant -c 'mailcatcher -f --http-ip=0.0.0.0 >> /var/log/mailcatcher/mailcatcher.log'

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