[OSProcess] image quitting too fast (?) in linux

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OSProcess] image quitting too fast (?) in linux

Sebastián Sastre
Hi all,
 
    I have a Squeak3.8-6665full.image running a Pier wiki in linux. I've managed to make some scripts to start and stop it headless.
    What I'm trying to do now is to make an option to stop this service saving the image. Right now it starts ok and quits without saving ok, but the option I've made to quit saving the image is not saving it.
 
    When I send the signal I see the process quiting immediately where in the other hand if I evaluate "SmalltalkImage current snapshot: false andQuit: true" in the squeak environment, it has a normal "image save delay".
 
    Perhaps the linux isn't giving enough time to the process so the image can save? anybody has a workarround  for this?
 
    thank you,
 
Sebastian
 
    Here is the relevant script:
 
 cleaner := [ 
  logger value:'Clearing handlers de WARegistry...' value: logFile.
  WARegistry clearAllHandlers.
  logger value:'Garbage collecting...' value: logFile.
  Smalltalk garbageCollect].
 
 quit := [OSProcess accessor forwardSigQuit wait.
 
  logger value:'Received SIGQUIT' value: logFile.
  cleaner value.
  logger value:'Closing squeak without saving image...' value: logFile.
  SmalltalkImage current snapshot: false andQuit: true].
 

 term := [OSProcess accessor forwardSigTerm wait.
 
  logger value:'Received SIGTERM' value: logFile.
  cleaner value.
  logger value:'Closing squeak saving image...' value: logFile.
  SmalltalkImage current snapshot: true andQuit: true].
 
 (Smalltalk at:#asistente)
  at:#quit put: quit;
  at:#term put: term;
  yourself.
I've also tried with SIGINT with the same result.