I wrote a simple bash script that does nothing but sleeps.
#!/bin/bash
echo "Sleeping..."
sleep 180s
I see two processes running on my system after running the script:
user 22880 0.0 0.0 12428 1412 pts/28 S+ 20:12 0:00 /bin/bash ./sleep.sh
user 22881 0.0 0.0 7196 356 pts/28 S+ 20:12 0:00 sleep 180s
I pass to the SIGTERMprocess with id 22880using kill -15 22880, which kills the process. However, after that, I still see that the sleep command is executing, which completes after 180 seconds.
user 22881 0.0 0.0 7196 356 pts/28 S 20:12 0:00 sleep 180s
Why is this happening? What do I need to do to stay in the process sleep 180s?
source
share