Hi,
I am writing a shell script to invoke a C++ program. Before I start the C++ program (oi7loadbalancer), I am checking if the process is already running. I start the process only if it is not already running. I have the following check in my script.
proccount=`ps -f -u $USER_NAME | grep... (8 Replies)
I have this script:
-------------------------------------------------------
#!/bin/ksh
#
if ] ||
]
then
echo "Executing main_load.sh script"
/usr1/psc_load/jobs/cron/main_load.sh "ods"
else
echo "File not found, do nothing"
fi
exit 0
... (4 Replies)
I have a requirement to check how long a process is running on unix system.If i use ps -ef i am getting the following message
guest 2453638 1998920 0 16:16:05 - 0:00 dsapi_slave 9 8 0
but this is showing only time not the date.Can any one please advice me any script to find out how... (2 Replies)
Hi ,
I have a csh code below which check the process if it's running.
Can any expert advise me on the following:
1) what does this notationmean ">!" and how is it different from the append ">" notation ?
2) how does "setenv" work in this code ?
# Check whether there is a running... (3 Replies)
Hi
What is the best command to check if a particular process is running in a linux server or not
To check any java process, I use the below command.
ps -ef |grep jvm
When I execute the above command, it lists me all the processess . The above command should ideally return only the... (6 Replies)
How to I check if a process is running in C? I'm trying to use ps aux |grep "process name" but failing in doing that. How do I do that?
Thanks, (1 Reply)
Hi,
I check if the process is running or not using the below.
/usr/ucb/ps auxww | grep 109 |grep rmi | awk '{print $2}'
9718
Thus we see 9718 is the PID.
It return blank if the process is not running.
I need to perform some action if the process is not running and leave it if... (8 Replies)
I have process1 running on one machine and generating some log file. Now another process which can be launched on any machine wants to know if process1 is running or not and also in case it is running it wants to stream the logs file generated by process1 on terminal from which process2 is... (2 Replies)
Hi Gurus,
t=`ps -u irb|grep -v grep|grep BSNL_PAYMENT_C`
echo $t
if
then
echo $?
echo "Process Creation is Running ...."
else
echo "Process went down at $dat $tim"
fi
How would i use loop so that the script continously checks for the current status of this process.... (1 Reply)
Discussion started by: ankitknit
1 Replies
LEARN ABOUT PHP
win32_start_service_ctrl_dispatcher
WIN32_START_SERVICE_CTRL_DISPATCHER(3) 1 WIN32_START_SERVICE_CTRL_DISPATCHER(3)win32_start_service_ctrl_dispatcher - Registers the script with the SCM, so that it can act as the service with the given nameSYNOPSIS
mixed win32_start_service_ctrl_dispatcher (string $name)
DESCRIPTION
When launched via the Service Control Manager, a service process is required to "check-in" with it to establish service monitoring and
communication facilities. This function performs the check-in by spawning a thread to handle the lower-level communication with the service
control manager.
Once started, the service process should do 2 things. The first is to tell the Service Control Manager that the service is running. This
is achieved by calling win32_set_service_status(3) with the WIN32_SERVICE_RUNNING constant. If you need to perform some lengthy process
before the service is actually running, then you can use the WIN32_SERVICE_START_PENDING constant. The second is to continue to check-in
with the service control manager so that it can determine if it should terminate. This is achieved by periodically calling
win32_get_last_control_message(3) and handling the return code appropriately.
PARAMETERS
o $name
- The short-name of the service, as registered by win32_create_service(3).
RETURN VALUES
Returns TRUE on success, FALSE if there is a problem with the parameters or a Win32 Error Code on failure.
EXAMPLES
Example #1
A win32_start_service_ctrl_dispatcher(3) example
Check if the service is runnig under the SCM.
<?php
if (!win32_start_service_ctrl_dispatcher('dummyphp')) {
die("I'm probably not running under the service control manager");
}
win32_set_service_status(WIN32_SERVICE_START_PENDING);
// Some lengthy process to get this service up and running.
win32_set_service_status(WIN32_SERVICE_RUNNING);
while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) {
# do some work here, trying not to take more than around 30 seconds
# before coming back into the loop again
}
?>
SEE ALSO win32_set_service_status(3), win32_get_last_control_message(3), Win32 Error Codes.
PHP Documentation Group WIN32_START_SERVICE_CTRL_DISPATCHER(3)