1

If I start the script by ./test.sh &, I am able to kill using kill -SIGINT PID.

But if I start my shell script using nohup ./test.sh & I am unable to kill the process using kill -SIGINT PID.

Kindly need your advice to kill the script using kill -SIGINT PID

Tom Fenech
  • 72,334
  • 12
  • 107
  • 141
james007
  • 741
  • 1
  • 12
  • 29

1 Answers1

2

The SIGINT signal means interrupt from keyboard; that's why it terminates a script run in foreground, but not in background neither using nohup.

To properly terminate your process use kill -TERM PID, which works in the 3 cases.

Edouard Thiel
  • 5,878
  • 25
  • 33