Skip navigation.
Home
The QNX Community Portal

View topic - re-run devc-pty

re-run devc-pty

Discussion about the QNX6 OS.

re-run devc-pty

Postby rashidmirza » Wed Nov 30, 2011 11:36 pm

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?
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am

Re: re-run devc-pty

Postby Tim » Thu Dec 01, 2011 5:29 pm

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
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Re: re-run devc-pty

Postby koko » Thu Dec 01, 2011 5:41 pm

Preventive actions are always possible, but you should find the root cause why that happens!
I have never seen such a greedy devc-pty.
koko
Senior Member
 
Posts: 100
Joined: Wed Aug 20, 2003 1:31 am

Re: re-run devc-pty

Postby maschoen » Fri Dec 02, 2011 10:07 am

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.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Re: re-run devc-pty

Postby rashidmirza » Sun Dec 04, 2011 5:53 pm

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 ?
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am

Re: re-run devc-pty

Postby maschoen » Sun Dec 04, 2011 9:51 pm

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.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Re: re-run devc-pty

Postby rashidmirza » Mon Dec 05, 2011 4:34 am

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.
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am

Re: re-run devc-pty

Postby maschoen » Mon Dec 05, 2011 7:39 am

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.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Re: re-run devc-pty

Postby rashidmirza » Mon Dec 05, 2011 12:05 pm

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
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am

Re: re-run devc-pty

Postby Tim » Mon Dec 05, 2011 6:03 pm

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
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Re: re-run devc-pty

Postby rashidmirza » Wed Dec 07, 2011 4:25 am

the devc-con was not slayed.
I cannot find the devc-con in the sysinit file...
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am

Re: re-run devc-pty

Postby Thunderblade » Wed Dec 07, 2011 2:23 pm

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. ;)
Thunderblade
Senior Member
 
Posts: 487
Joined: Thu Apr 07, 2005 11:52 am

Re: re-run devc-pty

Postby rashidmirza » Thu Dec 08, 2011 4:23 am

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 %
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am

Re: re-run devc-pty

Postby mario » Fri Dec 09, 2011 3:48 am

rashidmirza wrote: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.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am


Return to QNX6 - OS

Who is online

Users browsing this forum: No registered users and 2 guests

cron