cron starts a job every 10 minutes via a korn shell - I need to determine if the previous process is still running before I allow the new process to start - HELP
I've tried ps -ef, etc but I have seen many situation where it says that the is running when it is not - any ideas on how to absolutely... (2 Replies)
On HP-UX, in application, if the process id has been get with the getpid() and sotred in database, then other monitor process want to check it if the process is existed, are there any system function can do it? I do not want to use the shell script, because it should use popen function to excuted... (5 Replies)
Hi All,
I am new to perl and have been trying to write a short script to check a process.Though i havent reached to the stage where i can match the output.
I am trying to pass a variable x with value /opt/RGw/csbp-base/CSBP_BAT.01.00.05/csbp_BAT.01.00.05.jar
and then pass another variable... (2 Replies)
Hi Experts,
Is there any command by which i can chk that the cron process is running fine? Say i have scheduled the cron to run at 10 o clock every monday,Do i need to wait for the time it runs and then chk using ps -ef?
Please shed some light.
Thanks
Ashok. (2 Replies)
Hi
I have a scenario where i need to check multiple instances of a running shell script (abc.sh) .
How can I find from inside a running shell script whether any other instance of the same script is running or not? If any other instance of same shell script is running I need to exit from... (4 Replies)
Hi,
I want to create a script who will check if the java process is running & if it finds the process is still there it continues to execute & when the process completes it exit from the script.
I have written a code to check & notify the process existence but i am not getting how to write... (4 Replies)
Hi,
I am trying to write a script which will fire alert mail to dba ( db2dba) when there process will
utilize CPU more than 90%. But I am unable to do so.
I am using following command to calucate CPU utilization be db2sysc process :
ps -eo pcpu,pid,comm | grep -i db2sysc | awk '{ SUM+=$1;... (0 Replies)
Hi,
I am trying to write a script which will fire alert mail to dba ( db2dba) when there process will
utilize CPU more than 90%. But I am unable to do so.
I am using following command to calucate CPU utilization be db2sysc process :
ps -eo pcpu,pid,comm | grep -i db2sysc | awk '{ SUM+=$1;... (6 Replies)
Hello there ULF,
Good day! Just want to share my code and as well as my problem on why I'm not getting the output that I want. My original code was:
#!/usr/bin/sh
echo
echo -n "Please input an IP-Pool: "
read ip
echo
echo "Please wait....."... (8 Replies)
Hi All,
I am writing script for Env refresh for Oracle DB. I am using Datapump for that. If i start expdp or impdp, how can i know that export or import has completed. I have query for that. How will i integrate with script?. Or any command i can run from Linux side. Please share you... (1 Reply)
Discussion started by: pvmanikandan
1 Replies
LEARN ABOUT SUNOS
kill
kill(2) System Calls kill(2)NAME
kill - send a signal to a process or a group of processes
SYNOPSIS
#include <sys/types.h>
#include <signal.h>
int kill(pid_t pid, int sig);
DESCRIPTION
The kill() function sends a signal to a process or a group of processes. The process or group of processes to which the signal is to be
sent is specified by pid. The signal that is to be sent is specified by sig and is either one from the list given in signal (see sig-
nal.h(3HEAD)), or 0. If sig is 0 (the null signal), error checking is performed but no signal is actually sent. This can be used to check
the validity of pid.
The real or effective user ID of the sending process must match the real or saved (from one of functions in the exec(2) family) user ID of
the receiving process, unless the privilege {PRIV_PROC_OWNER} is asserted in the effective set of the sending process (see intro(2)), or
sig is SIGCONT and the sending process has the same session ID as the receiving process. A process needs the basic privilege
{PRIV_PROC_SESSION} to send signals to a process with a different session ID. See privileges(5).
If pid is greater than 0, sig will be sent to the process whose process ID is equal to pid.
If pid is negative but not (pid_t)-1, sig will be sent to all processes whose process group ID is equal to the absolute value of pid and
for which the process has permission to send a signal.
If pid is 0, sig will be sent to all processes excluding special processes (see intro(2)) whose process group ID is equal to the process
group ID of the sender.
If pid is (pid_t)-1 and the {PRIV_PROC_OWNER} privilege is not asserted in the effective set of the sending process, sig will be sent to
all processes excluding special processes whose real user ID is equal to the effective user ID of the sender.
If pid is (pid_t)-1 and the {PRIV_PROC_OWNER} privilege is asserted in the effective set of the sending process, sig will be sent to all
processes excluding special processes.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned, no signal is sent, and errno is set to indicate the error.
ERRORS
The kill() function will fail if:
EINVAL The sig argument is not a valid signal number.
EPERM The sig argument is SIGKILL and the pid argument is (pid_t)-1 (that is, the calling process does not have permission to
send the signal to any of the processes specified by pid).
The effective user of the calling process does not match the real or saved user and the calling process does not have the
{PRIV_PROC_OWNER} privilege asserted in the effective set, and the calling process either is not sending SIGCONT to a
process that shares the same session ID or does not have the {PRIV_PROC_SESSION} privilege asserted and is trying to send a
signal to a process with a different session ID.
ESRCH No process or process group can be found corresponding to that specified by pid.
USAGE
The sigsend(2) function provides a more versatile way to send signals to processes.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO kill(1), intro(2), exec(2), getpid(2), getsid(2), setpgrp(2), sigaction(2), sigsend(2), signal(3C), signal.h(3HEAD), attributes(5), privi-
leges(5), standards(5)SunOS 5.10 22 Mar 2004 kill(2)