I've seen a few topics on this before on AskUbuntu and bits and pieces from other forums but no answer actually solved my query. I'm trying to kill a service on my Ubuntu machine via SSH (Terminal), here's the things that I've tried:
- used systemctl kill [servicename]
- used htop to kill the processes
Is there a way to edit the service file (possibly) so it'll kill the service instead of trying to shut it down (if that's the only way around it)?
The service uses uwsgi, using uwsgi.ini, and it runs on 5 processes which is why killing one doesn't kill it in the end.
After trying to kill it using htop or systemctl kill, it seems the processes respawn, or at least that is what I think is happening from my diagnostics. I'm trying to restart the service to apply the changes that I've made to the code, but annoyingly I can't due to ...this. Any help would be much appreciated.
I've also tried adding in
Restart=always
and RemainAfterExit=no
to the service file but that didn't make a difference either.
Here's the service:
Description=uWSGI instance to serve live ver. of project
After=network.target
[Service]
User=root
Group=root
Restart=always
RemainAfterExit=no
WorkingDirectory=/var/www/project
Environment="PATH=/root/.pyenv/versions/3.7.2/envs/project/bin"
ExecStart=/root/.pyenv/versions/3.7.2/envs/project/bin/uwsgi --ini uwsgi.ini
[Install]
WantedBy=multi-user.target