Skip to content
All posts
DevOps

Installing Supervisor On Amazon Linux 2023

February 21, 2024·Read on Medium·

Eliminating installation troublesome of Supervisor in AL2023

Amazon Linux 2023 stands as a reliable choice for developers and system administrators. However, users may face a hiccup: Supervisor, is absent from the default RPM packages. This omission poses a challenge for efficiently managing and monitoring processes on Amazon Linux instances.

But fret not! This guide will walk you through the steps to effortlessly install Supervisor on Amazon Linux 2023 using Pip, ensuring smooth sailing for your process management needs.

Understanding the Challenge

AL2023 is RPM-based and includes components sourced from multiple versions of Fedora and other distributions, such as CentOS 9 Stream. The Amazon Linux kernel is sourced from the long-term support (LTS) releases directly from kernel.org, chosen independently from other distributions.

BUT, the absence of Supervisor (Refer Here) in the default package repository complicates matters for users reliant on its intuitive process management capabilities. Supervisor streamlines the task of controlling and monitoring processes, making it indispensable for system administrators and developers. Without it, overseeing complex applications and services becomes significantly more cumbersome.

Installing Supervisor on Amazon Linux 2023 with Pip:

Step 1: Prerequisites:

Before proceeding, ensure your instance has Python and Pip installed. You can verify their presence by running the following commands:

sudo dnf install python3 python3-pip

Step 2: Install Supervisor

Once Python and Pip are available, installing Supervisor becomes a breeze. Execute the following command to install Supervisor using Pip:

sudo pip install supervisor

Step 3: Generate Supervisor Configuration File

After installation, generate the default configuration file for Supervisor using the following command:

echo_supervisord_conf > /etc/supervisor/supervisord.conf

Step 4: Customize Configuration (Optional)

Feel free to customize the generated configuration file according to your specific requirements. You can edit /etc/supervisor/supervisord.conf using your preferred text editor.

I would suggest to create the conf.d folder inside the /etc/supervisor/ and modify the supervisord.conf to include the folders.

[include]
files = /etc/supervisor/conf.d/*.conf

Step 5: Start Supervisor Service

With Supervisor installed and configured, start the Supervisor service using the following command:

sudo supervisord -c /etc/supervisor/supervisord.conf

We might want to auto start this supervisor service once reboot or on start server. Create a service called “supervisord.service”

sudo vim /usr/lib/systemd/system/supervisord.service

and paste this script inside the file

[Unit]
Description=Process Monitoring and Control Daemon
After=rc-local.service nss-user-lookup.target

[Service]
Type=forking
ExecStart=/usr/local/bin/supervisord -c /etc/supervisor/supervisord.conf

[Install]
WantedBy=multi-user.target

You might need to reload the daemon as it new script is created

sudo systemctl daemon-reload

Step 6: Verify Installation

Confirm that Supervisor is up and running by checking its status:

sudo systemctl enable supervisord
sudo systemctl start supervisord
sudo systemctl status supervisord

Now you are good to go to create your own application supervisor config.

Conclusion

While Supervisor may not come pre-packaged with Amazon Linux 2023, installing it via Pip is a simple process that enhances your ability to manage processes effectively. By following the steps outlined in this guide, you can equip your Amazon Linux instances with Supervisor, empowering you to streamline process control and monitoring. Whether you’re overseeing intricate applications or managing critical services, Supervisor on Amazon Linux 2023 ensures smooth operation in the ever-evolving landscape of cloud computing.

In Plain English 🚀

Thank you for being a part of the In Plain English community! Before you go:

Found this helpful?

If this article saved you time or solved a problem, consider supporting — it helps keep the writing going.

Originally published on Medium.

View on Medium
Installing Supervisor On Amazon Linux 2023 — Hafiq Iqmal — Hafiq Iqmal