Skip to content

Running Services

In my experience it's better to use systemd rather then putting your head under this supervisor setup


  • For supervisor when you want to autostart some service on boot

command=flask run --port 1337

Then restart the supervisor service

sudo systemctl restart supervisor.service

And then you can check if the service is running by executing

supervisorctl status

You should see the new app.

Sometime we end up getting error like

unix:\\\var\run\supervisor.sock no such file


error: <class socket.sock>..........

So the fix that seemed to work for me was to run echo_supervisord_conf > /etc/supervisor/supervisord.conf

and then reread the config with

supervisorctl -c /etc/supervisord/supervisord.conf reread

and then we should see all the services running.

Systemd service file

In my experience it's better to just make a <name>.service file in /etc/systemd/system to setup a service rather than trying to mess with supervisor.


If you want something to do with shells or a service accesible via nc/telnet then it's better to setup a xinetd service.


  • Sometimes when you start the xinetd service you might get an error about no service game/tcp etc if this is the case just open /etc/services and add your service name with the port you are running it on.

game        1337/tcp        #this is a game

Here game is the name of the service and 1337 is the port on which it is running. Text after # is just a comment.

Other application with Systemd

This is just an example of flask application but in the similar manner you can run any other service as well. Ex: apache2


Basically make a file named whatevernameyouwant.service in /etc/systemd/system and write this:

Description=web application

ExecStart=/bin/bash -c "/usr/local/bin/flask run --host --port 80 "