cannot kill deluged with bash script?
by shams from LinuxQuestions.org on (#50GVQ)
I am running manjaro gnome 19.0.2, when i am shutting down the system it takes 5 minutes to stop the deluged process, i want to create a systemd service to run a bash script before shutdown and kill the deluged process, i checked the deluged process:
Code:$ ps aux | grep deluged
deluge 1191 0.9 1.4 288944 52696 ? Ssl 20:13 0:04 /usr/bin/python /usr/bin/deluged -dThis is the bash script to kill the deluged process:
Code:#!/bin/bash
PID=$(ps -ef | grep deluged | grep -v grep | awk '{print $2}')
echo $PID
/usr/sbin/sudo /usr/bin/kill -9 $PIDOk now i am running this code as a user and will see the output:
Code:./test.sh
1191The script got the correct pid and run the kill command, now let's see the deluged process again:
Code:$ ps aux | grep deluged
deluge 2453 1.0 1.3 288948 52096 ? Ssl 20:23 0:01 /usr/bin/python /usr/bin/deluged -dThe deluged daemon is still running but now with another pid, if i run this script several times cannot terminate the deluged process and it gets another pid..


Code:$ ps aux | grep deluged
deluge 1191 0.9 1.4 288944 52696 ? Ssl 20:13 0:04 /usr/bin/python /usr/bin/deluged -dThis is the bash script to kill the deluged process:
Code:#!/bin/bash
PID=$(ps -ef | grep deluged | grep -v grep | awk '{print $2}')
echo $PID
/usr/sbin/sudo /usr/bin/kill -9 $PIDOk now i am running this code as a user and will see the output:
Code:./test.sh
1191The script got the correct pid and run the kill command, now let's see the deluged process again:
Code:$ ps aux | grep deluged
deluge 2453 1.0 1.3 288948 52096 ? Ssl 20:23 0:01 /usr/bin/python /usr/bin/deluged -dThe deluged daemon is still running but now with another pid, if i run this script several times cannot terminate the deluged process and it gets another pid..