-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Description
In the following script, a pharo process waits a os process. Then I save&quit and re-open the image, and the OS process answers it's running. I would expect a negative answer, or at least, to have another testing method that answers false. But didn't find one. Should we modify isRunning or add a new testing method?
osSubprocess :=
OSSUnixSubprocess new
command: 'tail';
arguments: #('-f' '/var/log/system.log' );
yourself.
pharoProcess := [ osSubprocess runAndWait ] fork.
"-- Accessing details in SAME session --"
osSubprocess. "OSSUnixSubprocess(Command: tail; Pid: 98737; Status: Not finished)"
pharoProcess isTerminated. "false"
osSubprocess isRunning. "true"
OSSVMProcess vmProcess childPids. "an OrderedCollection(98737)"
"-- Accessing details in ANOTHER session (after save&quit and reopen) --"
osSubprocess. "OSSUnixSubprocess(Command: tail; Pid: 98737; Status: Not finished)"
pharoProcess isTerminated. "true"
osSubprocess isRunning. "true"
OSSVMProcess vmProcess childPids. "an OrderedCollection()"The OSSVMProcess clean ups the collection of child processes on image resume:
startUp: resuming
resuming ifTrue: [ self initializeVMProcessInstance ]
My opinion is that isRunning should test if its pid is included in OSSVMProcess's childPids