LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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
 
LinkBack Search this Thread
Old 01-31-2002, 03:53 PM   #1
butthead
LQ Newbie
 
Registered: Nov 2001
Location: Guilderland, NY
Distribution: SuSe 8.1
Posts: 13

Rep: Reputation: 0
Question script at xwin start to kill old process(es)


I have written a web-based point of service application (SUSE 7.0 (but going to 7.2 shortly), Apache web-server & Netscape browser) that has a background process which controls its transaction processing. I have left in the CTRL-ALT-BACKSPACE command just in case the user gets into somewhere from which there is no escape. This works well, but does not kill the background process - so when the windows manager restarts, an additional run of the background process is started.

Has anyone ever scripted a check for and kill of a specific existing background process? I'm looking for a sample/direction.

Thanks!!
 
Old 01-31-2002, 04:18 PM   #2
TacKat
Member
 
Registered: Jan 2002
Distribution: LFS
Posts: 90

Rep: Reputation: 15
Well, you could have the script check all the process entries in /proc for the cmdline of the program then kill that pid.
 
Old 01-31-2002, 09:16 PM   #3
crabboy
Moderator
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,822

Rep: Reputation: 120Reputation: 120
Modify your background process to write out its pid to a file in /var/run. The good daemon processes like mysql, apache, inetd do.

As for a script to check for and kill the process. Look at the apachectl script. I think it is a good example of what you are looking for.
 
Old 02-01-2002, 08:39 AM   #4
butthead
LQ Newbie
 
Registered: Nov 2001
Location: Guilderland, NY
Distribution: SuSe 8.1
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks a ton! I'll be trying it out this weekend.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why my script die itself when I try to kill a process?? jaimese Linux - Newbie 4 10-27-2005 05:50 AM
Script to see if a process ir running, if not start it ncsuapex Programming 4 07-03-2005 01:27 PM
how do i kill a process from inside a bash script? mikaelo Programming 4 05-28-2004 08:51 AM
Kill a process launched by a shell script gsbarry Programming 7 01-06-2004 02:09 PM
BASH script inform user and kill process mounters Programming 3 02-11-2002 04:57 PM


All times are GMT -5. The time now is 11:39 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration