1819828 Members
3118 Online
109607 Solutions
New Discussion юеВ

kill with nohup

 
SOLVED
Go to solution
ust3
Regular Advisor

kill with nohup

I would like to use kill with nohup function , I know it should use "kill -TERM" but if I want to also use kill level , for example "kill -8" , can advise how can I combine these function ? I tried "kill -TERM -8" is not work .

thx
11 REPLIES 11
Kapil Jha
Honored Contributor

Re: kill with nohup

I did not understand ur problem.
>>>I would like to use kill with nohup function

what does this mean.Do you want to put a job in background and then kill ot or what????
Kapil
I am in this small bowl, I wane see the real world......
Dennis Handly
Acclaimed Contributor
Solution

Re: kill with nohup

If you are asking about my nohup suggestion in your other thread, you should really have asked there, rather than create another thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1180435

For that to have worked, you would have to first collect the PIDs. Then use nohup of another script passed the PIDs, to protect the kill from its parent shell dying.

>for example "kill -8", can advise how can I combine these function?

What do you mean by a kill level?
Kill only takes a signal and a list of PIDs.
ust3
Regular Advisor

Re: kill with nohup

thx reply ,

What do you mean by a kill level?
Kill only takes a signal and a list of PIDs.

do you mean I should use "nohup kill -8"
to prevent it kill myself ?

thx
ust3
Regular Advisor

Re: kill with nohup

thx reply ,

I see the man page , there is command "kill -s SIGTERM " , is it used for waiting all process is killed before shutting down ? thx
Dennis Handly
Acclaimed Contributor

Re: kill with nohup

>do you mean I should use "nohup kill -8"
to prevent it kill myself?

That's even easier that what I thought. The kill will complete, even if the script dies.
Of course anything after that, may not be done.
Also you don't want to use kill -8, SIGFPE.

>there is command "kill -s SIGTERM", is it used for waiting all process is killed before shutting down?

Kill -s SIGTERM the same as the default. It tells the processes to terminate when they are able.
ust3
Regular Advisor

Re: kill with nohup

thx reply and sorry to my fool,

I still not clear the difference between "kill -s SIGTERM -8" and "nohup kill -8" , what I want is make sure they can kill all process , even when it its self login process , so before it die , it should do the kill all process .
Dennis Handly
Acclaimed Contributor

Re: kill with nohup

>I still not clear the difference between "kill -s SIGTERM -8" and "nohup kill -8"

Where are you getting -8 from? Is 8 your process group ID? If not remove it from your thoughts.

>what I want is make sure they can kill all process, even when it its self login process, so before it die

Basically adding nohup should do it. Because it creates a new process that shouldn't be in the list of processes to kill. And if the parent dies, nohup should preserve the kill process.

There is no difference between "kill -s SIGTERM" and "kill".
ust3
Regular Advisor

Re: kill with nohup

thx reply,

Where are you getting -8 from? Is 8 your process group ID? If not remove it from your thoughts. -->

I know kill have -1 , -2 , -3 ... for diferent propose , I just check that -8 is not vaild .

Thx for your help .

Dennis Handly
Acclaimed Contributor

Re: kill with nohup

>I know kill have -1, -2, -3 ... for different propose, I just check that -8 is not valid.

Are you talking about signals or PIDs?
You should not normally use kill -8 or SIGFPE.
ust3
Regular Advisor

Re: kill with nohup

thx

I am talking the signal .

I think kill -3 will do in my case.

thx.
Dennis Handly
Acclaimed Contributor

Re: kill with nohup

>I think kill -3 will do in my case.

You should take the default. SIGQUIT will create core files for each process.