You are not logged in.

#1 2005-04-17 09:34:59

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,436
Website

killall...but one?

I am trying to get silent shutdown support in gensplash for Arch, problem is that Arch kills the daemon almost straight away at shutdown using a killall command.

Is there anyway I can tell it not to kill the splash daemon or get a list of all processes and stop all of them but my daemon?  Aside from that little prob it works great.

I tired restarting the daemon after the killall but that is a crap work around

Offline

#2 2005-04-17 10:24:27

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: killall...but one?

where is the killall taking place? In an rc.d script?
You could probably do some serious grepping and string massaging to get at the invidual pid's


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2005-04-17 15:49:32

Krzysiek_W
Member
From: Poland, Bialystok - tam gdzie
Registered: 2004-12-08
Posts: 45
Website

Re: killall...but one?

s there anyway I can tell it not to kill the splash daemon or get a list of all processes and stop all of them but my daemon?

something like pgrep and pkill ?

pgrep -v xmms

will list all processes id without xmms p. id

the same I think work with pkill, but I don't want to try :]


Greetings
Krzysiek Wojszko

Offline

#4 2005-04-18 03:56:41

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,436
Website

Re: killall...but one?

that looks good

cactus - take a look at /etc/rc.shutdown

Offline

#5 2005-05-05 04:38:18

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,436
Website

Re: killall...but one?

This is the code i have to replace

# Terminate all processes
stat_busy "Sending SIGTERM To Processes"
/sbin/killall5 -15 &> /dev/null
/bin/sleep 5
stat_done

stat_busy "Sending SIGKILL To Processes"
/sbin/killall5 -9 &> /dev/null
/bin/sleep 1
stat_done

But it ain't so easy because:

killall5 is the SystemV killall command. It sends a signal to all processes except kernel threads and the processes in its own  session,  so it  won't kill the shell that is running the script it was called from. Its primary (only) use is in the rc scripts found  in  the  /etc/init.d directory.

So, the way I see it i need to get a list of all procs and kill them all while preserving the same procs as killall5 AND preserving the splashutil daemon.

OR if I understand correctly, i can call the daemon directly from the rc.shutdown script and killall5 won't kill it? At the mo it is called in a remote script?

Offline

Board footer

Powered by FluxBB