Hi Daniel,
Well you've certainly
constructed a perpetual
infinity loop ... the while(1)
will make sure of this ... and
so you have a runaway process ..
but you know about ps -aux and
displaying the PID from this command
you can kill the process:
kill -9 PID_NO
where PID_NO is the process id displayed.
On some occasions , a process will re-spawn
itself .. so quick in fact, it's not humanly
possible to keep killing them manually ...
in that case you can search the ps - output
and grep the process name and ID and have a
script do this ..
regards
SunDog
======================================================
Daniel Falkenberg wrote:
>
> List,
>
> I have the following code that I ran on my UNIX system but because I am
> inexperienced with Perl I don't actually know if the Damon has stopped
> running. I closed the TTY I was running it on but if I do a ps aux on
> my system it tells me I am still running the damon script? How do I go
> about stopping this script...
>
> Regards,
>
> Daniel Falkenberg
>
> #!/usr/bin/perl -w
>
> #Testing daemons
>
> use POSIX qw(setsid);
>
> chdir '/' or die "Can't chdir to /: $!";
> umask 0;
> open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
> #open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!";
> open STDERR, '>/dev/null' or die "Can't write to /dev/null: $!";
> defined(my $pid = fork) or die "Can't fork: $!";
> exit if $pid;
> setsid or die "Can't start a new session: $!";
>
> while(1) {
> sleep(5);
> print "Hello...\n";
> }
>
> ==============================
> VINTEK CONSULTING PTY LTD
> (ACN 088 825 209)
> Email: [EMAIL PROTECTED]
> WWW: http://www.vintek.net
> Tel: (08) 8523 5035
> Fax: (08) 8523 2104
> Snail: P.O. Box 312
> Gawler SA 5118
> ==============================
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]