mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-04-13 09:42:01 +00:00
Adding monit for original page server for when it crashes.
This commit is contained in:
parent
a390981b93
commit
87620eb4e1
2 changed files with 18 additions and 0 deletions
12
config/monit_original.conf
Normal file
12
config/monit_original.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
set daemon 120
|
||||
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set eventqueue
|
||||
basedir /var/monit # set the base directory where events will be stored
|
||||
slots 100 # optionally limit the queue size
|
||||
|
||||
# If no feeds have been fetched in the last 10 minutes, something is wrong
|
||||
check file task-newsblur.log with path /srv/newsblur/logs/original_page.log
|
||||
if timestamp > 10 minutes then exec "/srv/newsblur/utils/kill_node.sh"
|
||||
# as uid sclay and gid sclay
|
6
fabfile.py
vendored
6
fabfile.py
vendored
|
@ -491,6 +491,11 @@ def config_monit_node():
|
|||
sudo('echo "START=yes" > /etc/default/monit')
|
||||
sudo('/etc/init.d/monit restart')
|
||||
|
||||
def config_monit_original():
|
||||
put('config/monit_original.conf', '/etc/monit/conf.d/node_original.conf', use_sudo=True)
|
||||
sudo('echo "START=yes" > /etc/default/monit')
|
||||
sudo('/etc/init.d/monit restart')
|
||||
|
||||
def config_monit_app():
|
||||
put('config/monit_app.conf', '/etc/monit/conf.d/gunicorn.conf', use_sudo=True)
|
||||
sudo('echo "START=yes" > /etc/default/monit')
|
||||
|
@ -1005,6 +1010,7 @@ def setup_original_page_server():
|
|||
setup_node_app()
|
||||
sudo('mkdir -p /srv/originals')
|
||||
sudo('chown %s.%s -R /srv/originals' % (env.user, env.user)) # We assume that the group is the same name as the user. It's common on linux
|
||||
config_monit_original()
|
||||
put('config/supervisor_node_original.conf',
|
||||
'/etc/supervisor/conf.d/node_original.conf', use_sudo=True)
|
||||
sudo('supervisorctl reread')
|
||||
|
|
Loading…
Add table
Reference in a new issue