I can only capture the pid of envVarSetter and not the pid of dataCrunch.exe as the latter would be spawned as the child of envVarSetter and not as the child of main spawner / controller
So collecting pid here
1) is not useful for checking the status of process whether its running or not
2) or for creating a lock files because lock file would be created before the actual process is spawned.
For ex:
This is how the process is spawned in sequence.
Here, how can I fit the usage of pids here.
If I have not explained properly or improperly please do let me know
Problem
I have an application which basically runs lots of UNIX programs remotely, using the Telnet protocol. For each program it remotely executes, it stores the process ID (PID) for that process.
At regular intervals, I would like my application to take the PID for every process still... (5 Replies)
is there a way to find the process id of a process because i have same process invoked several times.
when i need to kill them, i get confused with the id.
Thanks,
sskb
:( (8 Replies)
Hi,
If in a shell script i write a command
ls > bla &
ls
The output is redirected to bla and the next ls starts as first one is going on in background.
I want to find the PID of the first command.
Thanks in advance (2 Replies)
Hi Gurus,
How can i find background process is completed or not. I have mentioned my scenario below.
Actually Pr1 Process is running in back ground, i just want to know whether this process completed or not. I can come to know the process id by typing pid=$! but i want to trigger... (4 Replies)
Hello,
Iam running a apache webserver in CentOS recenlty a hacker has attacked my server using RFI attack and did something in my server.. After that everyday at 8Pm my httpd is using about 5000 pid's actually in normal it takes only about 30 - 40 pid's. and also exim uses 2000 pid's totally my... (2 Replies)
Hi
Any idea how to get the process id of the process using the ports
lsof -i :portnumber does not work in my machine. I am on sun Solaris SPARC.
Any suggestion is highly appreciated (1 Reply)
Afternoon all, hopefully someone can give me a hand with this (the following may be explained very poorly :rolleyes: )
I know there's a process running on one of our Solaris 10 boxes that runs approximately every 5 minutes. Unfortunately I've no idea, who owns it, what it is called, or how it is... (2 Replies)
Hello,
The scenario is as follows, I have a background process running initially for which i know the PID on machine1. I use ssh from machine 2 to execute a script in machine 1. For some reason the back ground process is terminated. I would like to know which process caused the... (6 Replies)
Hi,
I am trying to find a file that have a different name than it should be processing, the file name is ( Fifa15 )
is there a command to use?
I got that file by
ps -ef | grep fifa15
but how do I know what is running ?
thanks a lot, I am learning unix so sorry if that is a... (2 Replies)
Discussion started by: latinooo
2 Replies
LEARN ABOUT DEBIAN
io::async::pid
IO::Async::PID(3pm) User Contributed Perl Documentation IO::Async::PID(3pm)NAME
"IO::Async::PID" - event callback on exit of a child process
SYNOPSIS
use IO::Async::PID;
use POSIX qw( WEXITSTATUS );
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my $kid = $loop->fork(
code => sub {
print "Child sleeping..
";
sleep 10;
print "Child exiting
";
return 20;
},
);
print "Child process $kid started
";
my $pid = IO::Async::PID->new(
pid => $kid,
on_exit => sub {
my ( $self, $exitcode ) = @_;
printf "Child process %d exited with status %d
",
$self->pid, WEXITSTATUS($exitcode);
},
);
$loop->add( $pid );
$loop->run;
DESCRIPTION
This subclass of IO::Async::Notifier invokes its callback when a process exits.
For most use cases, a IO::Async::Process object provides more control of setting up the process, connecting filehandles to it, sending data
to and receiving data from it.
EVENTS
The following events are invoked, either using subclass methods or CODE references in parameters:
on_exit $exitcode
Invoked when the watched process exits.
PARAMETERS
The following named parameters may be passed to "new" or "configure":
pid => INT
The process ID to watch. Must be given before the object has been added to the containing "IO::Async::Loop" object.
on_exit => CODE
CODE reference for the "on_exit" event.
Once the "on_exit" continuation has been invoked, the "IO::Async::PID" object is removed from the containing "IO::Async::Loop" object.
METHODS
$process_id = $pid->pid
Returns the underlying process ID
$pid->kill( $signal )
Sends a signal to the process
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::PID(3pm)