Technology
Systemd
Ask AI
How to configure systemd service files to manage Corridor Platform component processes.
Systemd is a common process management service that comes preinstalled in systems like RHEL7+,
Ubuntu, etc. This makes it easy to use as no additional installation is required and can be used
with minimal effort and some additional configurations. If sudo access isn’t available, Corridor’s own Daemons can be used instead.
Configurations
Section titled “Configurations”Once installed, the supervisor configuration needs to be created per process that needs to be managed.
To set-up the configurations, the following steps need to be followed:
- Add service file to systemd services folder. For example:
/etc/systemd/system/corridor.service - To start service:
sudo systemctl start corridor
And to run the service on startup:sudo systemctl enable corridor
Here are some example configuration files for the Corridor components:
Web Application server:
[Unit]Description=Corridor Web ApplicationAfter=syslog.target network.target
[Service]User=rootExecStart=/bin/bash -c 'INSTALL_DIR/venv-app/bin/corridor-app run \ >> /var/log/corridor/corridor-app.log 2>&1'Restart=always
[Install]WantedBy=multi-user.targetAPI server:
[Unit]Description=Corridor APIAfter=syslog.target network.target
[Service]User=rootExecStart=/bin/bash -c 'INSTALL_DIR/venv-api/bin/corridor-api run \ >> /var/log/corridor/corridor-api.log 2>&1'Restart=always
[Install]WantedBy=multi-user.targetAPI - Celery worker:
[Unit]Description=Corridor Worker APIAfter=syslog.target network.target
[Service]User=rootExecStart=/bin/bash -c 'INSTALL_DIR/venv-api/bin/corridor-worker run --queue api \ >> /var/log/corridor/corridor-worker-api.log 2>&1'Restart=always
[Install]WantedBy=multi-user.targetSpark - Celery worker:
[Unit]Description=Corridor Worker SparkAfter=syslog.target network.target
[Service]User=rootExecStart=/bin/bash -c 'INSTALL_DIR/venv-api/bin/corridor-worker run --queue spark --queue quick_spark \ >> /var/log/corridor/corridor-worker-spark.log 2>&1'Restart=always
[Install]WantedBy=multi-user.targetJupyter Notebook:
[Unit]Description=Corridor JupyterAfter=syslog.target network.target
[Service]User=rootExecStart=/bin/bash -c 'INSTALL_DIR/venv-api/bin/corridor-jupyter run \ >> /var/log/corridor/corridor-jupyter.log 2>&1'Restart=always
[Install]WantedBy=multi-user.targetWas this page helpful?
Thanks for the feedback.