Sponsored Content
Top Forums Shell Programming and Scripting Multiple PID for the same script Post 302236048 by dennis.jacob on Sunday 14th of September 2008 10:43:30 AM
Old 09-14-2008
Quote:
1. Is it normal to have more than 1 PID for the script which is being run using cron command?
What is that script trying to do..? Are you calling any other scripts/applications inside your script? If that is the case, what you are referrung may be the child processes.

Quote:
3. Can i kill all the pid's related to the script and then will cron automatically start(new PID) the script?
Make entries in the script before the startup to see any existing processes and kill it(its not a fair idea to kill the process if you have a neat option to stop the application process/script)..

Something like below can be used to kill the process.

ps -ef| grep "application" | grep " 1 " | xargs kill -9
 

10 More Discussions You Might Find Interesting

1. Programming

printing ppid,child pid,pid

question: for the below program i just printed the value for pid, child pid and parent pid why does it give me 6 values? i assume ppid is 28086 but can't figure out why there are 5 values printed instead of just two! can someone comment on that! #include<stdio.h> #define DIM 8 int... (3 Replies)
Discussion started by: a25khan
3 Replies

2. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

3. Shell Programming and Scripting

Recursive pid script

I'm trying to create a script that allows me to determine all the pid's that spawned from an original process(ie - who's running this command).... I've created a script that searches the processes running based on an argument passed the script. It then is to get the parent pid and look that... (3 Replies)
Discussion started by: jbarnhar
3 Replies

4. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

5. Shell Programming and Scripting

how to capture PID for a child script

Hi, I'm looking for a method where we can capture the PID and if possible the progress of child process especially the ones running in background. can anyone help? (6 Replies)
Discussion started by: aman jain
6 Replies

6. Solaris

PID Provider dtrace script

I'm just starting to mess about with dtrace on Solaris. How do I configure a probe in a PID provider dtrace script to trigger when the process being traced exits? I've tried pid$1:::exit where $1 is the PID but I get 'exit' is an invalid probe name (0 Replies)
Discussion started by: JerryHone
0 Replies

7. Shell Programming and Scripting

pid.cleanup script.

Hi guys! I have a directory in the production environment from which i have to delete files older then 40 minutes with .pid extention. I wrote a script below for the purpose. #!/bin/bash # # Script to delete specific file older than N minutes. # OLDERTHAN="40" #40 minutes ... (6 Replies)
Discussion started by: sajid.shah
6 Replies

8. Shell Programming and Scripting

Kill a PID using script

Hi, I wrote a script to kill a process id. I am able to kill the PID only if I enter the root password in the middle of the execution because I did not run as root i.e after i run the script from the terminal, instead of killing directly, it is killing only after entering the pass when it... (12 Replies)
Discussion started by: rajkumarme_1
12 Replies

9. Shell Programming and Scripting

script to extract PID

Can anyone explain the below script which is used to extract the PID? Why they are taking from 10 character and getting the sub string? Note:variable pid has been assigned the PID value initially as below. pid=`sed 's@FILNAME@'$destFil'@g' $scriptname |sed 's@SRCFILE@'$sourceFil'@g' |sed... (2 Replies)
Discussion started by: bk_12345
2 Replies

10. UNIX for Advanced & Expert Users

Need script to monitor pid.

Need Cron script to monitor the process. if its down, it should alert with an email. (1 Reply)
Discussion started by: pranav987
1 Replies
killall(1M)															       killall(1M)

NAME
killall - kill all active processes SYNOPSIS
[signal] DESCRIPTION
is a procedure used by to kill all active processes not directly related to the shutdown procedure. is chiefly used to terminate all processes with open files so that the mounted file systems are no longer busy and can be unmounted. sends the specified signal to all user processes in the system, with the following exceptions: the process; all processes (including background processes) associated with the terminal from which was invoked; any process, if owned by any process, if owned by any process; any process; any process. obtains its process information from and therefore may not be able to perfectly identify which processes to signal (see ps(1)). If no signal is specified, a default of (kill) is used. is invoked automatically by The use of is recommended over using by itself (see shutdown(1M)). FILES
SEE ALSO
fuser(1M), kill(1), ps(1), shutdown(1M), signal(5). STANDARDS CONFORMANCE
killall(1M)
All times are GMT -4. The time now is 09:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy