What is the advantage of using supervisord over monit?

I haven’t used monit but there are some significant flaws with supervisord. Programs should run in the foreground This means you can’t just execute /etc/init.d/apache2 start. Most times you can just write a one liner e.g. “source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND” but sometimes you need your own wrapper script. The problem with wrapper scripts … Read more

Redis Daemon not creating a PID file

For those experiencing on Debian buster: Editing nano /etc/systemd/system/redis.service and adding this line below redis [Service] ExecStartPost=/bin/sh -c “echo $MAINPID > /var/run/redis/redis.pid” It suppose to look like this: [Service] Type=forking ExecStart=/usr/bin/redis-server /etc/redis/redis.conf ExecStop=/bin/kill -s TERM $MAINPID ExecStartPost=/bin/sh -c “echo $MAINPID > /var/run/redis/redis.pid” PIDFile=/run/redis/redis-server.pid then: sudo systemctl daemon-reload sudo systemctl restart redis.service Check redis.service status: sudo … Read more

How to monitor delayed_job with monit

Here is how I got this working. Use the collectiveidea fork of delayed_job besides being actively maintained, this version has a nice script/delayed_job daemon you can use with monit. Railscasts has a good episode about this version of delayed_job (ASCIICasts version). This script also has some other nice features, like the ability to run multiple … Read more

Debugging monit

I’ve had the same problem. Using monit’s verbose command-line option helps a bit, but I found the best way was to create an environment as similar as possible to the monit environment and run the start/stop program from there. # monit runs as superuser $ sudo su # the -i option ignores the inherited environment … Read more

tech