LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-19-2005, 07:09 AM   #1
dibblethewrecke
Member
 
Registered: Nov 2003
Location: UK
Distribution: Arch Linux
Posts: 210

Rep: Reputation: 30
killall...but one?


This is synthesized from my threads on our forums:

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

This is the code i have to replace

Code:
# 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:

Quote:
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.

Last edited by dibblethewrecke; 05-19-2005 at 07:11 AM.
 
Old 05-19-2005, 11:31 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Why do you want compromise your system stability when it tries to
have a clean shutdown executing cleanup procedures ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
killall gnome-panel simple Linux - Newbie 9 06-02-2005 11:42 PM
Alternatives for 'killall' Wallace740 Linux - Newbie 3 03-30-2005 03:21 AM
kill/killall not working (?) didi156 Linux - Software 2 05-20-2004 11:47 PM
Killall program bluedude2288 Programming 2 04-12-2004 09:57 PM
C code for killall function Linh Programming 3 08-01-2003 11:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration