Created
May 15, 2015 03:34
-
-
Save sean-kang/3a4845899742d4fb1e7c to your computer and use it in GitHub Desktop.
Lita wrapper to make it managed by monit
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
1. service wrapper to generate PID | |
#!/usr/bin/env bash | |
PIDFILE=/home/lita/lita/tmp/lita.pid | |
case $1 in | |
start) | |
cd /home/lita/lita ; | |
echo $$ > ${PIDFILE} ; | |
exec bundle exec lita start >> /home/lita/lita/log/lita.log 2>&1 ;; | |
stop) | |
kill `cat ${PIDFILE}` ;; | |
*) | |
echo "usage: $0 {start|stop}" ;; | |
esac | |
exit 0 | |
2. monit config (using monit's pid and gid parameters caused path issue.) | |
check process lita | |
with pidfile /home/lita/lita/tmp/lita.pid | |
start program = "/bin/su lita -c '/home/lita/lita/bin/lita start'" | |
stop program = "/bin/su lita -c '/home/lita/lita/bin/lita stop'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment