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-pipStep 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 supervisorStep 3: Generate Supervisor Configuration File
After installation, generate the default configuration file for Supervisor using the following command:
echo_supervisord_conf > /etc/supervisor/supervisord.confStep 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/*.confStep 5: Start Supervisor Service
With Supervisor installed and configured, start the Supervisor service using the following command:
sudo supervisord -c /etc/supervisor/supervisord.confWe 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.serviceand 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.targetYou might need to reload the daemon as it new script is created
sudo systemctl daemon-reloadStep 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:
- Be sure to clap and follow the writer ️👏️️
- Follow us: X | LinkedIn | YouTube | Discord | Newsletter
- Visit our other platforms: CoFeed | Differ
- More content at PlainEnglish.io