CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@Kaustubh Katdare • 08 Jan, 2020

Wondering which is better option among supervisord and systemd. The systsemd is the default but it never works as expected for me. 

I spent about 1.5 days trying to get filebeat working with app-search ( the system that powers the search on CrazyEngineers ) and couldn't get the logs to work. 

Then out of frustration, I tried supervisord; configured it within 3 minutes and wow - it got everything working!

Reading through a few recommendations on the Internet - people seem to be divided. Some say that because systemd is default, stick to it. But if systemd is so awesome, why does supervisord exist? What problem does it solve? 

... and finally - what exactly is the difference when I start a process / program with either of the two? 

@Abhishek Rawal • 08 Jan, 2020 • 2 likes

systemd is an init system ; while supervisord is a process control system.
Though it seems that their function in similar, and they do share some goals; but supervisord is not meant as substitute of an init system. (Your system wouldn't be able boot without an init system, PID 1 is the init process, it's the starting point of user-space)

init system is the standard interface, and I recommend using it rather than another process control applications like supervisor.

If you could elaborate your problem in detail, I would like to help you out for the same.

@Kaustubh Katdare • 08 Jan, 2020

Thank you, Abhishek. I'm not sure how to describe the problem. I was trying to configure filebeat logging system to work with app-search. Logging didn't work when I initiated the app-search and filebeat with systemd. Then I decided to initiate the process using supervisord and it automatically initiated filebeat. I'm super newbie when it comes to server administration (despite working with servers for several years). I think we could discuss the problem in a separate discussion.

Coming back to the main topic, I get that systemd is an init system. However, supervisor is being widely used as a replacement and I wonder what's the deal. 

Isn't systemd meant to control the processes as well? I guess that's what happens when I run systemctl start/stop something.service

@Abhishek Rawal • 08 Jan, 2020 • 1 like

I have used filebeat, and have configured custom systemd unit as per requirement. I am curious to know what is the issue are you facing. Let's keep that discussion for different thread.

Coming back to topic, If your multiple applications are running in single container (not as per best practice). This is where you are recommended to use supervisord. (systemd don't work in containers) I am not sure what other benefits supervisord provides over systemd for process management. (May be service status GUI?)

Yes, but systemd controls process in lot better way than supervisor does. I am not sure if supervisor supports zombie reaping, process inheritance and signal forwarding.
Just an example of one : Parent process fork() multiple child processes, somehow parent process dies. The orphan processes are inherited by init.

All features supervisord provides are there in systemd, plus many more which supervisord is not capable to provide. Supervisord would've been better alternative if sysVinit and upstart wasn't replaced by systemd.


Related Posts

@Abhishek Rawal · Oct 12, 2013

I found Arduino IDE not a good tool to edit arduino sketches & upload it in Arduino, especially in my Linux system(Editor kinda sucks & it's slow). So, I searched...

@Kaustubh Katdare · Aug 26, 2014

WhatsApp has been showing the nasty "Failed. Out of memory. Please try again later." error message whenever I send multiple photos to a group or any of my content. After...

@Kaustubh Katdare · Apr 9, 2015

If you are scared to read the entire article because it looks VERY LONG, this article is meant for you. The whatsapp addiction is apparently becoming more dangerous than other...

@kashmirihasan · Jul 12, 2013

How to make a pure sine wave ups ??? any circuit diagram? and what is the difference between a pure sine wave ups and modified sine wave?

@sahilmahotra · Jan 17, 2015

hiii.....Ankita this is sahil btech ( IT ) can u plz help me ...i am going for drive of john deere . i need help to know about written test...