SUMMARY: Script to create a lot of processes?

From: Carl Christopher Bavington @ Langley (@)
Date: Fri Feb 14 2003 - 11:31:27 EST


Managers, Thanks to all who replied, espically to Dr. Thomas P. Blinn and Dr
Tim Cutts
The while loop several people suggested were owned by 1 when killing the
shell.
The one i popped for was a perl script:

Try the following perl script. This is a *really* nasty fork bomb, so
don't run it on a production system. Some systems behave very badly if
you do this to them :-)

#!/usr/bin/perl

my @pids = ();
my $pidcount = 0;
my ($pid);

while (defined($pid = fork)) {
    if ($pid) {
        push (@pids, $pid);
        $pidcount++;
    } else {
        @pids = ();
        sleep 3600;
        exit 0;
    }
}

if (@pids) {
    kill 9, @pids;
    print $pidcount, "\n";
}

> -----Original Message-----
> From: Carl Christopher Bavington @ Langley
> Sent: 14 February 2003 14:43
> To: Tru64 Managers Mail Group (E-mail)
> Subject: Script to create a lot of processes?
>
> I am wanting a script which creates a lot of PIDs with the same PPID to
> test the max-proc-per-user kernel param regarding another problem i have.
> And im be v.stupid and cant think of an easy way to do this, trying to use
> & in a loop makes the PPID 1
>
> Any ideas???.
>
> Carl Bavington
> Senior Technical Analyst (CAS)
> ntl
>

The contents of this email and any attachments are sent for the personal attention
of the addressee(s) only and may be confidential. If you are not the intended
addressee, any use, disclosure or copying of this email and any attachments is
unauthorised - please notify the sender by return and delete the message. Any
representations or commitments expressed in this email are subject to contract.
 
ntl Group Limited



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:08 EDT