shelljobskilljob-control

Cannot kill stopped job - no job control in subprocess?


I'm working with ash/dash and try to kill a subprocess - which doesn't seem to respond:

sh & opens a subprocess and jobs delivers [1]+ Stopped (tty Input) sh.

But trying to kill this Job with kill %1 or kill 26672 doesn't work. jobs delivers [1]+ Stopped (tty Input) sh again.

After putting the job to foreground with fg opens the shell for input. Neither ctrl+c nor ctrl+z are working but I can kill the process with exit or kill -SIGKILL $$ respectively stop/suspend the process with kill -STOP $$ (there is no suspend-command in ash).

On the other hand - doing this with i.e. sleep 100 works fine till I fg and stop the process with ctr+z. Then I'm not able to kill this stopped job.

So what am I missing and what could be the solution to kill a stopped job? Do I have to deal with set -m and how?

Thanks in advance.


Solution

  • You can rung the Stopped process by kill -SIGCONT %numberand also if you need to kill that process you can kill it by kill -SIGTERM %number.Try this I think this will help you.