- Ubuntu 18.04 Server
I have multiple services running, that are all something like following template:
[Unit] Description=projectA After=multi-user.target [Service] WorkingDirectory=/media/deployment/deployment/projectA/src User=userA Group=userA ExecStart=/media/deployment/scripts/projectA Type=simple Restart=on-failure RestartSec=3 TimeoutStartSec=1 TimeoutStopSec=1 [Install] WantedBy=multi-user.target
projectA looks like this:
#!/bin/sh source /opt/venvs/projectA/bin/activate cd /media/deployment/deployment/projectA/src git pull python3.7 -m pip install -r /media/deployment/deployment/projectA/requirements.txt script -c "python3.7 main.py" -f "/media/deployment/logs/projectA.log"
Note: Every service has his own venv.
This works fine. However there is a reproducible bug:
If I restart one service
sudo systemctl restart projectA every other service gets non responsive.
Meaning that with
systemctl status it says "active" and logs do not show any kind of error.
However, as this services are mostly python flask apps, they simply do not respond on webrequests anymore.
Also noticable: Non flask apps, like a Discordbot I host or just pure python scripts are working fine.
Is there something wrong with my configuration?
I used to have a smiliar setup on a Windows Server and there everything, including restarts, never seemed to effect anythingelse.
What I figured out:
If I just
systemctl stop the service, everything works fine.
The "problem" occurres while (re)starting the service.