Created
December 15, 2013 10:57
-
-
Save dakatsuka/7971555 to your computer and use it in GitHub Desktop.
/etc/init.d/mailcatcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PID_FILE=/var/run/mailcatcher.pid | |
NAME=mailcatcher | |
PROG=/opt/rbenv/versions/1.9.3-p484/bin/mailcatcher | |
USER=mailcatcher | |
GROUP=mailcatcher | |
start() { | |
echo -n "Starting MailCatcher" | |
if start-stop-daemon --stop --quiet --pidfile $PID_FILE --signal 0 | |
then | |
echo " already running." | |
exit | |
fi | |
start-stop-daemon \ | |
--start \ | |
--pidfile $PID_FILE \ | |
--make-pidfile \ | |
--background \ | |
--exec $PROG \ | |
--user $USER \ | |
--group $GROUP \ | |
--chuid $USER \ | |
-- \ | |
--foreground | |
echo "." | |
return $? | |
} | |
stop() { | |
echo -n "Stopping MailCatcher" | |
start-stop-daemon \ | |
--stop \ | |
--oknodo \ | |
--pidfile $PID_FILE | |
echo "." | |
return $? | |
} | |
restart() { | |
stop | |
start | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
restart | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks so much for your work on this!
I need to add the --ip=x.x.x.x parameter to the upstart script. Any guidance you might offer? Cheers