Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Suspending a process
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Cojack
n00b
n00b


Joined: 06 Feb 2003
Posts: 32
Location: Seattle, WA USA

PostPosted: Sun Oct 19, 2003 10:34 pm    Post subject: Suspending a process Reply with quote

I'm looking for a way to suspend/resume another user's running process. I've tried using the STOP and CONT signals with kill, but the program just bombed out. Is this the fault of the program, or something I could overcome with a different command?

Any help would be appreciated.
_________________
Na-Na-Na-Na-Na-Na-Na-Na Leader!
Back to top
View user's profile Send private message
dma
Guru
Guru


Joined: 31 Jan 2003
Posts: 437
Location: Charlotte, NC, USA

PostPosted: Sun Oct 19, 2003 10:41 pm    Post subject: Reply with quote

Code:
root@laureate:/usr/include# stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;

From stty(1):
       susp CHAR
              CHAR will send a terminal stop signal


kill -STOP (some-pine-pid)

I tried it with pine and it works, but "fg" doesn't restore the terminal junk properly. No problems with "cat". Not sure how to restart it from the outside.
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Sun Oct 19, 2003 11:04 pm    Post subject: Reply with quote

STOP and CONT are the correct signals for this and they usually work well. But you can't send them to processes you don't own (unless $UID==0 of course).
Which program are you talking about? It probably doesn't do proper signal handling.
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Sun Oct 19, 2003 11:12 pm    Post subject: Reply with quote

dma wrote:
Code:
root@laureate:/usr/include# stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;

From stty(1):
       susp CHAR
              CHAR will send a terminal stop signal

I'm curious: are ^Q and ^S equivalent to SIGSTOP and SIGCONT?
I always thought they just made the shell block stdout so the app can't write on it anymore while the signals really stop the program execution.
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum