[prev in list] [next in list] [prev in thread] [next in thread]
List: colinux-users
Subject: Re: [coLinux-users] Help needed starting and closing coLinux VM
From: Henry Nestler <henry.ne () arcor ! de>
Date: 2010-01-30 19:37:21
Message-ID: 4B648A71.6030803 () henry ! ne ! arcor ! de
[Download RAW message or body]
On 28.01.2010 20:41, Frank Church wrote:
> I am using Lazarus/FreePascal to run a coLinux VM but the shutdown
> process just seems to terminate it abruptly and I would like to know
> if there is some other way.
>
> eg when you close click on the close button of a coLinux terminal
> window, it prints out a yellow notice and goes through a controlled
> shutdown process. In my case when I close from the Lazarus app, the
> window disappears abruptly, and I wonder if goes through a controlled
> shutdown.
>
> The start process is like this.
>
> vmProcess := TProcess.Create
> vmProcess.CommandLine := 'c:\colinux\coLinux-daemon.exe -k -t NT -d
> @rt.conf';
> vmProcess.Execute;
> ShowMessage('process pid = ' + IntToStr(vmProcess.ProcessID));
>
> The ccommand to close is like this.
>
> if Assigned(vmProcess) then
> begin
> vmProcess.Active := False;
> vmProcess.Free;
> end;
>
> Is there some value I can derive from the ProcesID than I can use to
> send a message to windows to close it properly?
I'm not a user of Pascal. I think, you killed the process to shortly
after Active := False with the Free of this object.
http://lazarus-ccr.sourceforge.net/docs/fcl/process/tprocess.execute.html
I would say, you needs to use "Terminate" and than check "Running" in a
time limited loop with some idle time for the CPU, to let the process
gracefully shutting down. Last get the exit code with WaitOnExit.
--
Henry N.
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
coLinux-users mailing list
coLinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/colinux-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic