Operating System - HP-UX
1752782 Members
6511 Online
108789 Solutions
New Discussion юеВ

Re: One Interesting Problem for U geeks

 
SOLVED
Go to solution
Sundar_7
Honored Contributor

One Interesting Problem for U geeks

Hi all,

I ran a C Program which forks() some processes

continuously in a infinte loop..

It has created some 100's of processes

in mins and the system is now damn slow..

and it is not ready to give birth to any

more process.

So here is thing.

We all sys Admins decided to try out

"Who will succeed in executing atleast an ls

without rebooting the system ? "

and after so many tries we have one

solution..

But I would like to know from U geeks

what U will do when the system's process table

is full and U exceeded maxuprc (remmeber U are

not a Super User)..

I would like to have some more ways from U

guys to execute atleast an ls when the system

is in above said condition..

Waiting for replies

Thanks in advance

Sundar


Learn What to do ,How to do and more importantly When to do ?
8 REPLIES 8
Patrick Wallek
Honored Contributor

Re: One Interesting Problem for U geeks

If you have hit maxuprc limit then you don't have much hope of doing anything until some processes die off. If you as a user have a lot of processes, you have to kill some off first. You can do a 'ps -f' to see what processes you are running and then kill the unnecessary ones. After that you should be able to do whatever you need to do.
MANOJ SRIVASTAVA
Honored Contributor

Re: One Interesting Problem for U geeks

Hi Sundara

Nothing much to do if the no of macuprc is full , you cant do anyhting unless

1. Someone ( including root ) kills the allocated process.

2. The process initated by that user completes and exits , hence frees some of the processes available.

All the best .


Manoj Srivastava
Paula J Frazer-Campbell
Honored Contributor
Solution

Re: One Interesting Problem for U geeks

Hi

I you can get/or have a telnet session open that you can sacrifice your shell to execute a clean up procedure:-

E.G.

exec

HTH

Paula
If you can spell SysAdmin then you is one - anon
Kenneth Platz
Esteemed Contributor

Re: One Interesting Problem for U geeks

Sundara,
When I was in college some of the more enterprising students used to do precisely what you describe -- created a C program with the following line:

main() {
while(1){
fork();
}
}

The only way our administrators were able to kill these processes was to reboot the system. The problem is these processes are reproducing at such a rate that they will chew up your entire process table and nobody will be able to create a new process on the system. Yes, they'll die off because they are exceeding maxuprc, but as one dies off, another one will fork() to take its place.

My recommendation of the above code is "DON'T DO IT". When you have something like this chewing up resources so quickly, there really is no easy way of killing it without rebooting your system.
I think, therefore I am... I think!
Satish Y
Trusted Contributor

Re: One Interesting Problem for U geeks

If u kill the parent process, child processes automatically taken over by init and get completed and then process table will be cleared off. If u can't kill parent process means nothing u can do other than waiting for some other to be root and kill ur parent or reboot the m/c.

Cheers...
Satish.
Difference between good and the best is only a little effort
John Bolene
Honored Contributor

Re: One Interesting Problem for U geeks

We did that in Xwindows class and had a script that popped up backgrounded nohup xclock remote windows on the terminals in the classroom with a do while loop.

The windows popped until they started to slow on all machines and we had to reboot all classroom machines.

Since you are not getting any work done on that machine anyway, hit the TOC button and reboot it.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Ron Irving
Trusted Contributor

Re: One Interesting Problem for U geeks

geek...I resemble that comment.
Should have been an astronaut.
Sundar_7
Honored Contributor

Re: One Interesting Problem for U geeks

Hi,,

One Paula came up with what I expected..

Even though Urprocess table is full U can

execute the commands using exec as it is not

going to create any sub shell or process..

so exec will work out..

Anyways..

Thanks to all of U

Sundar
Learn What to do ,How to do and more importantly When to do ?