monit

what is the advantage of using supervisord over monit

老子叫甜甜 提交于 2019-12-31 08:49:10
问题 We have a custom setup which has several daemons (web apps + background tasks) running. I am looking at using a service which helps us to monitor those daemons and restart them if their resource consumption exceeds over a level. I will appreciate any insight on when one is better over the other. As I understand monit spins up a new process while supervisord starts a sub process. What is the pros and cons of this approach ? I will also be using upstart to monitor monit or supervisord itself.

Is there benefit to using Monit instead of a basic Upstart setup?

柔情痞子 提交于 2019-12-29 10:07:31
问题 I'm configuring my server to run node.js as a daemon. I've setup Upstart to handle startup and shutdown of node, which works wonderfully. The next step is to make sure that node.js is restarted if it dies. A few of the guides have suggested using Monit (or Fugue) to monitor the process (in Monit's case by doing an HTTP request to the server and waiting for a response). I'm happy to use something like Monit or Fugue, but I'm not sure why one wouldn't (or couldn't) just use Upstart's respawn

How to execute the command after sudo su

五迷三道 提交于 2019-12-25 08:27:25
问题 I need to execute "monit restart haproxy" command after sudo su. This is my script.sh sudo su monit restart haproxy. Here if i will execute the script.sh file then it will hang and it is not executing the monit restart haproxy command. Any idea. Thanks in advanced. 回答1: The sudo command is expecting you to enter a password which is why it will hang, you can use a pipe so that the password is passed to the command like this: echo <password> | sudo su monit restart haproxy. 回答2: Here comes some

Run php script in monit

空扰寡人 提交于 2019-12-24 13:24:13
问题 Good day. Is there any way to run a php "my_script.php" script as action in the fall a demon that keeps alive a node.js server? The script to execute deletes records from a table of connected persons: I tried different ways but it does not work me, currently the script that monitors the process is as follows: #monit script set logfile /var/log/monit.log check process nodejs with pidfile "/var/run/mi_server.pid" start program = "/sbin/start mi_server" stop program = "/sbin/stop mi_server" if

Terminal says delayed_job starting, but not doing anything

女生的网名这么多〃 提交于 2019-12-22 17:29:15
问题 I have an app that works perfectly on my local machine and am deploying it now. I have the VPS all set up and it pretty much works, as well. My problem comes from not being able to start delayed_job. I do the "ruby script/delayed_job start RAILS_ENV=production" while SSHd to the app and it returns "delayed_job: process with pid 11547 started." When I look for the process in htop, I can't find it. So I dug around and read that Monit can keep delayed_job going. I set that up, hoping I could

Monit bundle exec rails s

大憨熊 提交于 2019-12-18 09:25:44
问题 I have the following shell script that allows me to start my rails app, let's say it's called start-app.sh : #!/bin/bash cd /var/www/project/current . /home/user/.rvm/environments/ruby-2.3.3 RAILS_SERVE_STATIC_FILES=true RAILS_ENV=production nohup bundle exec rails s -e production -p 4445 > /var/www/project/log/production.log 2>&1 & the file above have permissions of: -rwxr-xr-x 1 user user 410 Mar 21 10:00 start-app.sh* if i want to check the process I do the following: ps aux | grep -v grep

Rerun a process in Monit if process stops

戏子无情 提交于 2019-12-13 20:50:04
问题 I have a script like this this: #!/usr/bin/php <?php file_put_contents('/home/vagrant/sleep.pid', getmypid()); sleep(9); exit(0); I want to write my Monit config so it makes sure this application is always running. This is my monit config: set daemon 5 check process program with pidfile /home/vagrant/sleep.pid start program = "/usr/bin/php /home/vagrant/myphp.php" But after my program exits Monit doesn't try to run it again. It kinda make sense but I was wondering if there is any way to tell

Use monit to monitor a java program

橙三吉。 提交于 2019-12-13 13:59:31
问题 I am writing to get some help regarding starting my java programs via Monit. I have written a start script program.sh. The monit code and the scipt code is given with this posting. The issue is that I am not able the start and stop the program using the the script file executed via monit. I can monitor the process if I start it using the terminal but I can't start/stop it with monit. The log from monit says "Failed to start" However, I can start and stop programs like ssh easliy from monit.

Restarting ffmpeg process using monit

天大地大妈咪最大 提交于 2019-12-11 09:54:28
问题 I am trying to use monit for monitoring the ffmpeg process. For this I first created a bash script that has 3 arguments(start, stop and restart). When I run the script manually from the terminal (./thisBashScript start, ./thisBashScript stop and ./thisBashScript restart ) everything works perfectly how it was designed. The process starts, creates and saves the current procees id into a pid file. After if I want to stop the process it takes the current pid file and and kills the process with

Node.js (sudo) and monit

依然范特西╮ 提交于 2019-12-10 21:54:49
问题 I have created an upstart script in order to daemonize juggernaut (a node.js app) The upstart script is the following description "juggernaut server" author "panojsee" start on startup stop on shutdown script # We found $HOME is needed. Without it, we ran into problems #export HOME="/home/ubuntu/src/juggernaut" chdir /home/ubuntu/src/juggernaut exec sudo /usr/bin/node server.js 2>&1 >> /var/log/node.log end script As you can see I want to run node with sudo (so that I can use Flash sockets).