Technical Help & Resources / Using systemctl - Managing Services on your Host

Using systemctl - Managing Services on your Host


Unlike the typicall systemctl used for service management. The host comes installed with supervisorctl to handle services.
This page provides a simple overview of the usage for supervisorctl.

List Services

To list all services, run the command below.

supervisorctl

This will start an interactive terminal, to get out of it just run exit


Starting and Stopping Services

The commands below can be used to start and stop your services.

supervisorctl start service1
supervisorctl stop service1

Getting Status of a Service

To check if your service is running and get details like uptime and the PID you can use the command below.

supervisorctl status service1

Adding a new Service

First edit the supervisord config file using the nano command

sudo nano /etc/supervisor/conf.d/supervisord.conf

Add the following configuration to the end of the file.
This example is for running a mysql deamon.

[program:mysql]
command=/usr/bin/mysqld_safe
user=mysql
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/mysql.log
environment=MYSQL_ROOT_PASSWORD="Password123"

Be sure to change the values to suit your service.
Save the changes made to the configuration file by pressing (CTL + S) to save and then (CTL + X) to exit.

Once configuration is complete, reload supervisorctl with the changes using the commands below.

supervisorctl reread
supervisorctl update

Now the next time your host boots up it should start the service along with the other services.