07-17-2016
Kill nohup process with changing PID
Hi there!
I have a tricky problem concerning a
nohup process:
I started a python2.7 script which loops over a function.
At the end it restarts the function. Due to a mistake I'm now having a never ending nohup process that I have to kill.
I started the program execution with:
>>
nohup python2.7 myscript.py
with
>>
ps -ef|grep nohup
I see that the PID is
constantly changing.
How can I kill all nohup processes.
I already tried:
killall -9 myscript.py
pkill myscript.py
Did not work.
Thanks for your help!
Lydia
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Is there any build in command in unix to kill all the child process for a given process ID ? If any one has script or command, please let me know.
Thanks
Sanjay (4 Replies)
Discussion started by: sanjay92
4 Replies
2. Shell Programming and Scripting
I need to write a shell script which would take 2 arguments pid , userid. Then it should kill all the child process under it. If a child process is not killed then it should wait for 1 minute and should kill.
can anybody give me the idea to write it? (0 Replies)
Discussion started by: nani_g
0 Replies
3. Shell Programming and Scripting
Hi All,
In my project i have two process runs in the back end.
Once i start my project, and execute the command ps, i get below output:
PID TTY TIME CMD
9086 pts/1 0:00 ksh
9241 pts/1 0:02 java
9240 pts/1 0:00 shell_script_bg
java with 9241 PID is the main... (4 Replies)
Discussion started by: rkrgarlapati
4 Replies
4. Shell Programming and Scripting
I want to print the pid of a nohup process to a file so later I can use the list of pid's in that file to stop the background processes again.
I use ksh on AIXv5.3:
nohup /start/script.ksh 1>/dev/null 2>&1
print $$ > .pid
nohup /start/script2.ksh 1>/dev/null 2>&1
print $$ >> .pid
But... (2 Replies)
Discussion started by: rein
2 Replies
5. Shell Programming and Scripting
#!/bin/sh
who
echo "\r"
echo Enter the terminal ID of the user in use:
echo "\r"
read TERM_ID
echo "\r"
ps -t $TERM_ID | grep sh
echo "\r"
echo Enter the process number to end:
echo "\r"
read PID
echo "\r"
kill -9 $PID
What this code does is ultimately grab the PID of a users sh... (6 Replies)
Discussion started by: psytropic
6 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have problem with killing red5 process running on linux server. As this process is continuously changing its PID so it can't be killed with "kill -9 PID" command.
First I used following command to list RED5 process
ps aux | grep red5
which showed me
root 5832 0.0 0.0 4820 756pts/0... (1 Reply)
Discussion started by: ninadgac
1 Replies
7. Shell Programming and Scripting
Hello,
I have problem with killing red5 process running on linux server. As this process is continuously changing its PID so it can't be killed with "kill -9 PID" command.
First I used following command to list RED5 process
ps aux | grep red5
which showed me
root 5832 0.0 0.0 4820 756pts/0... (4 Replies)
Discussion started by: ninadgac
4 Replies
8. Red Hat
Hi Expert,
I am not able to kill certain user process as root. I have tried using:
pkill -u uname
skill KILL -u uname
kill -9 PID
*** I have not using killall yet, since this server has more than 100 users online atm.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND... (1 Reply)
Discussion started by: regmaster
1 Replies
9. Shell Programming and Scripting
hi guys
i had written a shell script Display Information of all the File Systems
i want to find the pid and kill the process after few minutes.how can i obtain the pid and kill it???
sample.sh
df -a >> /tmp/size.log
and my cron to execute every minute every hour every day
* *... (5 Replies)
Discussion started by: azherkn3
5 Replies
10. Shell Programming and Scripting
Hi All, Looking for a quick LINUX shell script which can continuously monitors the flle size, report the process which is creating a file greater than certain limit and also kill that process. Can someone please help me on this? (4 Replies)
Discussion started by: vasavimacherla
4 Replies
LEARN ABOUT FREEBSD
nohup
NOHUP(1) BSD General Commands Manual NOHUP(1)
NAME
nohup -- invoke a utility immune to hangups
SYNOPSIS
nohup [--] utility [arguments]
DESCRIPTION
The nohup utility invokes utility with its arguments and at this time sets the signal SIGHUP to be ignored. If the standard output is a ter-
minal, the standard output is appended to the file nohup.out in the current directory. If standard error is a terminal, it is directed to
the same place as the standard output.
Some shells may provide a builtin nohup command which is similar or identical to this utility. Consult the builtin(1) manual page.
ENVIRONMENT
The following variables are utilized by nohup:
HOME If the output file nohup.out cannot be created in the current directory, the nohup utility uses the directory named by HOME to create
the file.
PATH Used to locate the requested utility if the name contains no '/' characters.
EXIT STATUS
The nohup utility exits with one of the following values:
126 The utility was found, but could not be invoked.
127 The utility could not be found or an error occurred in nohup.
Otherwise, the exit status of nohup will be that of utility.
SEE ALSO
builtin(1), csh(1), signal(3)
STANDARDS
The nohup utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
BUGS
Two or more instances of nohup can append to the same file, which makes for a confusing output.
BSD
July 19, 2001 BSD