11-08-2011
Killing a process which is running in different server
Consider two servers tst01 and tst02.
i need to log in tst01 and check for the processes which run in tst02.
then based on pid , i need to kill that process.
is it possible to achieve?
I am able to connect to tst02 using ftp.
But the problem is, if i use ps it says invalid command.
How i can overcome this and start and stop processes which are in different servers?
thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
how to get the list of process running in the server from the local machin n unix ? (3 Replies)
Discussion started by: guhas
3 Replies
2. UNIX for Advanced & Expert Users
I want to write a unix shell script that will check if a process (say debu) is running in the server or not. If no , then send a mail to the corresponding person to start the process??? (2 Replies)
Discussion started by: debu
2 Replies
3. Shell Programming and Scripting
Hi Friends,
I am new to this forum as well as new to shell scripting.
I have a problem here and i need someone to solve this.
Let us consider there are two processes(abc & def).There is a script which kills these two processes(i.e killtheprocess abc). Here abc is the argument .
There is a... (1 Reply)
Discussion started by: Prince89
1 Replies
4. Shell Programming and Scripting
Hello all,
I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted.
Thanks in advance
Regards,
pradeep kulkarni.
:mad: (13 Replies)
Discussion started by: pradeepmacha
13 Replies
5. Shell Programming and Scripting
I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time.
Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies
6. Shell Programming and Scripting
Hi. !
When I use the 'NOHUP' along with the '&', the process will be running in the background. Even when I attempt to close (Meaning 'EXIT') the session (say PUTTY in this case), it wont exit unless the process is completed.
But, say when I forcefully terminate the session (SHUT DOWN the... (2 Replies)
Discussion started by: WinBarani
2 Replies
7. UNIX for Dummies Questions & Answers
alright, i have been trying to kill a process for some time now and im having a hard time to close it. im not sure if anyone on here is familiar with Minecraft, but im running a server from LimestoneNetworks, i had one of my friends set it up since im not as good as he is with linux, he tryed... (13 Replies)
Discussion started by: tWkiLler96
13 Replies
8. Shell Programming and Scripting
I want to run a script that calls remote ssh and if it gets hung, I want to be able to kill that part of the script and run another command in the script
for example I have a statement like this:
if ];
then
export tapes=$(for tape in $(su - nacct -c 'ssh remote1 "cat... (1 Reply)
Discussion started by: newbie2010
1 Replies
9. Shell Programming and Scripting
Hi guys,
I am trying to write a script that logs into a remote server as root and greps a particular process, awks its PID and then xargs kill -9 .
This is the actual command :
for i in `cat nodes.txt`
do
ssh root@$i 'ps -ef | grep puppet | grep -v grep | awk "{print $2}" | xargs kill... (7 Replies)
Discussion started by: Junaid Subhani
7 Replies
10. Shell Programming and Scripting
I am running a script which will read the data from fail line by line and call the Java program by providing the arguments from the each line.
The Java code is working fast for few records and for some records its getting hanged not providing response for morethan one hour.
Currently am... (4 Replies)
Discussion started by: dineshaila
4 Replies
KILL(2) BSD System Calls Manual KILL(2)
NAME
kill -- send signal to a process
SYNOPSIS
#include <signal.h>
int
kill(pid_t pid, int sig);
DESCRIPTION
The kill() function sends the signal specified by sig to pid, a process or a group of processes. Typically, Sig will be one of the signals
specified in sigaction(2). A value of 0, however, will cause error checking to be performed (with no signal being sent). This can be used
to check the validity of pid.
For a process to have permission to send a signal to a process designated by pid, the real or effective user ID of the receiving process must
match that of the sending process or the user must have appropriate privileges (such as given by a set-user-ID program or the user is the
super-user). A single exception is the signal SIGCONT, which may always be sent to any descendant of the current process.
If pid is greater than zero:
Sig is sent to the process whose ID is equal to pid.
If pid is zero:
Sig is sent to all processes whose group ID is equal to the process group ID of the sender, and for which the process has permission;
this is a variant of killpg(2).
If pid is -1:
If the user has super-user privileges, the signal is sent to all processes excluding system processes and the process sending the
signal. If the user is not the super user, the signal is sent to all processes with the same uid as the user, excluding the process
sending the signal. No error is returned if any process could be signaled.
For compatibility with System V, if the process number is negative but not -1, the signal is sent to all processes whose process group ID is
equal to the absolute value of the process number. This is a variant of killpg(2).
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
kill() will fail and no signal will be sent if:
[EINVAL] Sig is not a valid, supported signal number.
[EPERM] The sending process is not the super-user and its effective user id does not match the effective user-id of the receiving
process. When signaling a process group, this error is returned if any members of the group could not be signaled.
[ESRCH] No process or process group can be found corresponding to that specified by pid.
[ESRCH] The process id was given as 0, but the sending process does not have a process group.
SEE ALSO
getpgrp(2), getpid(2), killpg(2), sigaction(2)
STANDARDS
The kill() function is expected to conform to IEEE Std 1003.1-1988 (``POSIX.1'').
4th Berkeley Distribution April 19, 1994 4th Berkeley Distribution