First of all, please keep in mind that I'm just learning how to write bash scripts like this, so there might be something I'm overlooking or there are parts of the script could be written in a better way than I have them.
I have a CentOS 7 server and I wrote a bash script to install and configure supervisor automatically for you and optionally run migrations for the job tables. Everything works fine, except for the part that starts the supervisord service.
The script I'm using can be found here: https://github.com/rawilk/new-server-setup/blob/master/bash-scripts/laravel-queues.sh
When the script runs and gets to the part where it is supposed to start supervisord, it outputs the following error:
Failed to start supervisord.service: Unit not found.
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib64/python2.7/socket.py line: 224
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib64/python2.7/socket.py line: 224
unix:///var/run/supervisor/supervisor.sock no such file
What I find interesting about this is that if I run systemctl start supervisord after I run this script, it starts up just fine.