LinuxQuestions.org
Review your favorite Linux distribution.
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 06-25-2007, 07:10 AM   #1
bjdea1
Member
 
Registered: Oct 2003
Posts: 37

Rep: Reputation: 15
Signal SIGSTOP being ignored - why?


Hi,
I have a program that monitors server load and sends SIGSTOP signal to a process group via killpg() to reduce load and then SIGCONT again to restart. The problem I'm having is one of the child processes in this process group will at times ignore the SIGSTOP signal, all the other processes will stop but this process will not. So all the other processes die off and this one process is left running. If you try to stop this process from the command line sometimes its stops for a few seconds then it will start up again all by itself. Its driving me nuts because its breaking the rules as far as I can tell.

Can anyone tell me any reason why a SIGSTOP signal may fail on this process or on any process? And is there anyway to work around such a situation? Such as being able to detect when a process may be likely to ignore a SIGSTOP signal and perhaps wait until its state changes back to normal again?

Please any help will be so greatly appreciated I can't begin to explain
 
Old 06-25-2007, 07:49 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
SIGSTOP can't be caught or ignored. Period. It will stop the program. The only way the program can continue is if someone sends it a SIGCONT. I suspect someone is doing that, sometimes right away, sometimes after a few seconds.

Can you temporarily modify the code in the runaway process to catch the SIGCONT signal and log when it receives one?

Hope this helps.
 
Old 06-25-2007, 08:10 AM   #3
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
I take it this rogue is not your code?

I think it's one of those things.
some processes just play up and there's very little you can do about it.
 
Old 06-25-2007, 08:31 AM   #4
bjdea1
Member
 
Registered: Oct 2003
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by wjevans_7d1@yahoo.co
SIGSTOP can't be caught or ignored. Period. It will stop the program. The only way the program can continue is if someone sends it a SIGCONT. I suspect someone is doing that, sometimes right away, sometimes after a few seconds.

Can you temporarily modify the code in the runaway process to catch the SIGCONT signal and log when it receives one?

Hope this helps.
Thanks to all for you rinput so far .

I beleived SIGSTOP could not be ignoreed too (and want to believe it) but I ran a strace on this process while it was actively being sent SIGSTOP signals and it only showed the SIGSTOP signals being sent to the process every second or so - as my program is meant to do. There were no SIGCONT signals. So its been a real annoyance for me. I could send this process 10 SIGSTOP signals and see them all in the strace (one after another) but the process would just keep running, completely ignoring the signals. How can it do this?

Im looking into some other way of controlling server load. My true aim is to turn fast high CPU intensive processes into slow low intensive CPU processes. Nice, Renice are not effective enough - I'm now researching on other process scheduling type settings, like changing timeslice of the runtime of the process and other such settings - if they can be changed??? What kind of functions are avaialble to modify scheduling? Changing the CPU intensity of a running process? What methods are available? Sorry I'm not too knowledgable about this stuff yet, still reading up on it all. Any input is greatly appreciated, thanks in advance.
 
Old 06-26-2007, 08:05 AM   #5
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
I found some interesting (and possibly unsettling) data by googling:

Code:
strace SIGCONT
 
Old 06-26-2007, 08:13 AM   #6
bjdea1
Member
 
Registered: Oct 2003
Posts: 37

Original Poster
Rep: Reputation: 15
After researching all the options, scheduling and real time processing I've come to the conclusion I don't like the limited control Linux gives you over process scheduling. I wish there was some simple way to force a process to be idle for x seconds. This is all I need - to be able to force a process off the process que for a period of time - or to force the process to remain on the "expired" process que for a certain length of time.
 
Old 06-27-2007, 09:48 AM   #7
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
I hate to mention this, because it probably opens a can of worms that's inconsistent with your dreams of how to spend your spare time (if any), but:

Have you thought of hacking the kernel to do exactly what you want?
 
  


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
Signal frequency out of range / please change signal timing starrynite Linux - Hardware 1 01-06-2007 11:18 AM
using SIGSTOP and SIGCONT Wazzz Programming 0 12-12-2006 01:50 AM
Signal Strength Meter shows low signal? falcon56215 Linux - Networking 0 09-15-2006 07:39 AM
Signal 6: Unknown Signal <=> Error with MAYA4.X under Linux SOLVED!!!! Faeroon Linux - Software 9 05-09-2003 01:57 PM
Signal: 6 (Unknown Signal) - Problems running a program Faeroon Linux - Software 86 01-14-2003 12:08 AM

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

All times are GMT -5. The time now is 04:43 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