LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-15-2009, 03:57 AM   #1
v_sharma
LQ Newbie
 
Registered: Jan 2009
Distribution: Scientific Linux, Fedora
Posts: 4

Rep: Reputation: 0
Sending signal SIGQUIT to a process forked by remote machine


Hi all,

The setup that I have is as follows:
There are two machines A & B connected to each other both running Redhat 7.3. From A, passwordless ssh to B is enabled, but B to A is not passwordless.
rsh between both the machines is passwordless. On both the machines I have installed my own signal handler for the signal 3 (SIGQUIT) using the environment variable LD_PRELOAD.

From A, a program is invoked on B using ssh or rsh in the following manner:

Machine A> /usr/bin/ssh <IP of B> <absolute path name of the program on B> <Set of arguments>
Machine A> /usr/kerberos/bin/rsh <IP of B> <absolute path name of the program on B> <Set of arguments>


On doing this the remote program (on B) is forked and it starts executing normally.
But I need to send to a signal (SIGQUIT) to the process forked on B so that my signal handler is invoked on B.

For this when I do like this:

Machine B> kill -3 <Pid of the process forked on B>


The process on B is immediately killed and the signal handler is not called. (I have tested that when I invoke the above program from B and then send it the signal SIGQUIT, the installed signal handler is called without any problem.) The processes on A (i.e. rsh and ssh) keep on executing but they are in the state T (maybe Traced).

Is there any way to send a signal to a process which has been invoked from a remote machine?

I searched for this and some results suggested that this cannot be done by ssh but by rsh. Also, in the man page of rsh it was given that :
"Rsh connects to the specified host, and executes the specified command. .... Interrupt, quit and terminate signals are propagated to the remote command; rsh normally terminates when the remote command does."

So I invoked the program using rsh from A to B and found out that on A two processes are created for rsh (In case of ssh only one process is created on A). On sending SIGQUIT to both of them using:
Machine A> kill -3 PId_1
Machine A> kill -3 PId_2

there seems to be no effect on the processes PId_1 and PId_2 and also the remote process on B remains unaffected.

Can anybody suggest what I am doing wrong here when sending the signal to the rsh process and what can I do to call my signal handler on the machine B? And why there are two processes for rsh while only one for ssh?

Hope I have made myself clear.

Thanks in advance
 
  


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
Sending signal to process & reading PID's Pranav S Programming 0 08-28-2008 09:31 AM
netconsole not sending syslog messages to remote machine cygnus-x1 Linux - General 1 12-06-2007 05:47 PM
Sending signal to child process DiAvOl Programming 6 05-16-2006 12:16 PM
Sending a signal to a process (Help me) rajesh_b Programming 2 09-17-2004 01:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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