Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 01-31-2002, 04:53 PM   #1
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.

Old 01-31-2002, 05:18 PM   #2
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, 10:16 PM   #3
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
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, 09:39 AM   #4
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.


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

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 06:50 AM
Script to see if a process ir running, if not start it ncsuapex Programming 4 07-03-2005 02:27 PM
how do i kill a process from inside a bash script? mikaelo Programming 4 05-28-2004 09:51 AM
Kill a process launched by a shell script gsbarry Programming 7 01-06-2004 03:09 PM
BASH script inform user and kill process mounters Programming 3 02-11-2002 05:57 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:35 AM.

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