Restart Supervisord with the following command. Then we set autostart and autorestart to true, so that the script auto starts when system boots, and automatically restarts in case it crashes.įinally, we specify the location of log files for standard error and standard output. Next, we set the file path to execute this shell script. You can refer to your script as long_process while using supervisord. Ībove the first line is the name for our process. $ sudo vi /etc/supervisor/conf.d/nfĪdd the following lines to it. Let us create a separate configuration file for our script at /etc/supervisor/conf.d. To add a process to supervisord for managing, you need to add its details in supervisord’s configuration files located at /etc/supervisor/conf.d. Let us make sure it is executable by running the following command. The above code basically keeps running and echoing the present date every 1 second. Let us assume you have the following shell script. Please note, supervisord supports programs running in foreground only. Now let us add a shell script to be managed by supervisord. Run the following command to check supervisord status. Run the following command to start & enable supervisord daemon. $ sudo dnf install epel-releaseĪfter you update EPEL repository, run the following commands to install supervisor. Run the following command to install EPEL repository. Open terminal and run the following commands to update system packages. Here are the steps to install supervisor in RHEL/CentOS/Fedora. supervisorctl is the command line interface that allows you to issue commands to supervisord. supervisord is the main server that runs as a daemon allowing you to start programs, restart crashed processes, exit tasks, and managing events during process lifetime. It consists of two components – supervisord and supervisorctl. In this article, we will look at how to install supervisor in RHEL/CentOS/Fedora. It is easy to use, simple, efficient, and used widely among businesses. It allows you to start, stop, restart, update processes in Linux. Supervisor is a useful utility to manage processes, applications, scripts and tasks in Linux.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |