SUMMARY: Script to create a lot of processes?

From: Carl Christopher Bavington _at_ Langley <Carl.Bavington_at_ntl.com>
Date: Fri, 14 Feb 2003 16:31:27 +0000

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 _at_pids = ();
my $pidcount = 0;
my ($pid);

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

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



> -----Original Message-----
> From: Carl Christopher Bavington _at_ 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
Received on Fri Feb 14 2003 - 16:32:08 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:44 NZDT