kill UNIXProcess

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

kill UNIXProcess

Postby aserov » Thu Oct 14, 2010 1:11 am

Hello,

I'm having problems killing UNIX process. Consider the following example:

Code: Select all
| process |

process := UNIXProcess execute: 'sleep 20' input: nil output: true error: true environment: UNIXEnvironment current.


When the code starts, I'm having two processes associated with it:

Code: Select all
lesha@inwin:~/imon$ ps -ef |grep sleep
lesha     4810  4806  0 13:10 pts/1    00:00:00 /bin/csh -c sleep 20
lesha     4811  4810  0 13:10 pts/1    00:00:00 sleep 20


But when I execute "process kill", sleep process still exists in the system:

Code: Select all
lesha@inwin:~/imon$ ps -ef |grep sleep
lesha     4811     1  0 13:10 pts/1    00:00:00 sleep 20


(seems like only "csh" process was killed).

Ubuntu 8.04, VAST 7.5.2

Alexey
aserov
 
Posts: 4
Joined: Thu Dec 11, 2008 2:09 am

Re: kill UNIXProcess

Postby koschate » Thu Oct 14, 2010 5:08 am

This no longer seems to be a problem in VA 8.0.2, which uses the default shell (ksh in AIX). You might consider pulling the updated UNIXProcesses application into your image, or hacking UNIXProcess class>>#executeInput:output:error:environment: to use a shell other than csh to see if it makes a difference for you.
koschate
[|]
 
Posts: 102
Joined: Thu Feb 01, 2007 7:24 am

Re: kill UNIXProcess

Postby koschate » Thu Oct 14, 2010 6:17 am

Do you care about this output? If not, just add "> /dev/null" to the command. Otherwise, maybe you should figure out some grep filter that will reduce the output to something you care about.
koschate
[|]
 
Posts: 102
Joined: Thu Feb 01, 2007 7:24 am

Re: kill UNIXProcess

Postby aserov » Thu Oct 14, 2010 11:26 pm

Yes, the huge ouput of the external script is handled in VAST, so redirecting to "/dev/null" is not an option.

I removed my previous post, because the solution was too easy. I added UNIXReadPipeStream>>#zeroize method, and occasionally execute "process stdout zeroize" to free the data in the stream:

Code: Select all
UNIXReadPipeStream>>#zeroize
    position := 0.
    stream := ReadWriteStream on: self bufferClass new.


In my previous post, I was asking about an ability to free the memory, stored in UNIXProcess>>stdoutStream variable. We have an external script, which produces much output, and all its output is stored in this variable. Thus, at some moment that output may fill all available memory.
aserov
 
Posts: 4
Joined: Thu Dec 11, 2008 2:09 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest

cron