I have a system, where cpu load was 100% continious. Investigation showed that the devc-pty was consuming more than 70% of cpu load. Decided to slay the process.
As soon as the devc-pty was slayed, the cpu load fell down to a sensible value, but i was unable to open a terminal window.
Is there any way how i can open terminal windows, once the devc-pty was terminated?
Assuming you have an Ethernet connection to this machine you could telnet in and then restart devc-pty.
As a long term solution you can have a watchdog process automatically restart devc-pty if its killed.
Tim
Preventive actions are always possible, but you should find the root cause why that happens!
I have never seen such a greedy devc-pty.
It is possible that even though devc-pty is consuming the cpu, it is not the culprit. This can happen easily in QNX as programs rely on resource manager such as devc-pty to provide many services.
ideally i would like to find the root cause, since it has happened to me on two machines running qnx.
I tried to restart the service, but when i tried to open a terminal window got the following message:
pterm: cannot find a free pseudo-tty
then i wanted to telnet to the device, but was unable to do so, and got same message as above.
the question is, if i slay the devc-pty, and am unable to open further terminal windows, how will i run the service, since there is no terminal window to type ?
Actually that’s the easy part.
Find out where devc-pty is started by the system. Instead run a simple program that you can write. In a loop it starts devc-pty and waits for it to die. Then it restarts it. I always put in a short delay so that if for some reason the program crashes immediately you don’t find yourself in a hard loop.
devc-pty is started in sysinit, and is initiated when the system boots.
You recommended doing a program, should this be like a c program, or a script program?
Should there be a check for termination signal of the devc-pty, and then restart as follows:
devc-pty -n 32 &
i am curious to know why this is happening, because now i have a third instant of this case, and it has happened on 3 different machines, running qnx 6.3.0.
Yes a ‘C’ program. I don’t know how a script program would work.
How about this:
while(1)
{
spawnl(P_WAIT, "/sbin/devc-pty", "devc-pty", "-n", "32", NULL);
sleep(1);
}
As I mentioned before, the problem is probably not devc-pty. You are using a quite old version of QNX 6 at this point, so it might be of benefit to upgrade.
BTW, I had a problem with qnx 6.3.0 related to two things, 1) The SCSI disk driver, 2) Multi-core. I never found out what the problem was but when I upgraded to 6.3.2 it went away. There might be some kernel bug related to multi-core. If you are running a multi-core system with the multi-core kernel, you might want to try the single core kernel and see if the problem goes away. If it does, I would bet that upgrading to 6.3.0 will solve the problem.
thanks for the info, it is valuable.
Before i get to do a program, i tried a simple step, but failed.
Since terminal windows could not be open (after i slayed the devc-pty) on e.g. ‘machine2’, i tried to restart the devc-pty from ‘machine1’ over Qnet, as follows:
#/net/machine2/sbin/devc-pty -n 32
i can see that the service has started, as i a pid for it, and go see it running in pidin, but it does not help to open a telnet or a terminal window, and still get the ‘cannot find a free pseudo tty’ on machine 2.
Is there some other service that needs to be run?
regards
I believe you need to run devc-con (or devc-tcon) as well. This is the interface to the keyboard/console screen that devc-pty uses.
You’ll probably have something in your sysinit file like ‘devc-con -n4 &’.
Not sure why devc-con would be gone though unless you slayed it too.
Tim
the devc-con was not slayed.
I cannot find the devc-con in the sysinit file…
You shouldn’t mess with devc-pty. If it is using lots of CPU, something is wrong with your application.
You said devc-pty was using 70%. Who was using the rest? Probably a process, or shell script, which is buggy and therefore consumes devc-pty.
To debug this, you could use priorities, or time partitioning. But you shouldn’t use these to work around the problem.
the rest of the usage was by the applications running on the machine.
Funny thing is, the applications run 24/7, and sometimes, out of the blue, i have the high usage of cpu by devc-pty, and then in the system monitor the cpu usage is constantly 100 %
When that happens use the System profiler to record what is going on. It’s very much likely that devc-pty is doing work on behalf of somebody else. If that is the case you should see messages being send to devc-pty.