Re: [KylixGroup] Migration of an NT service app to Kylix

[email protected] Fri, 26 Sep 2003 15:11:14 +0200
Newsgroups gmane.comp.lang.delphi.kylix
Message-ID <[email protected]>
hi,

i'm not a linux specialist, but afaik there is no such thing as a service with linux. any application 
can be run as service, and any service is 'jsut' an application.

to run a background job, you can:
start it as background job, by adding a ampersand to the command:
./myapp -param1=test &

or, fork out yourself. i've done that once with kylix. you'll get back a handle, or zero. depending 
on that, the thread is the newly created thread, or the thread is the initiating process.
now one thread just terminates, and the other keeps running. this way you give control back to 
the command line while still running in the background.

be carefull with opened file handles, i believe they are not all copied/valid in the new thread. 
other global vars can just be accessed.

h:=fork();
if h=0 then //this is the new thread
  dojob
else
  begin
    writeln ('forked in background, id: '+inttostr(h));
    terminate; //return to command line
  end;

fork declared in Libc.pas

regards

rene

Op vrijdag, september 26. 2003 14:52:44 schreef "Denis Dupere" <[email protected]> : 
> Hi,
> 
> I have an NT service application that I want to migrate to Kylix.  It
> doesn't seem to have an implementation of TService in Kylix.  What can I
> do to migrate?
> 
> Best regards,
> 
> Denis Dupere
> 
> 
> 
> 
> -------------------------------------------------------
> Forum / mailing list for Borland Kylix programmers
> Our web page:  http://groups.yahoo.com/group/kylixgroup
> To join the forum: [email protected]
> To unsubscribe:  [email protected]
> To post your messages:       [email protected]
> To contact the moderator:  [email protected]
> -------------------------------------------------------
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Upgrade to 128-Bit SSL Security!
http://us.click.yahoo.com/p7cEmB/s7qGAA/yigFAA/i7folB/TM
---------------------------------------------------------------------~->

-------------------------------------------------------
Forum / mailing list for Borland Kylix programmers
Our web page:  http://groups.yahoo.com/group/kylixgroup
To join the forum: [email protected]
To unsubscribe:  [email protected]
To post your messages:       [email protected]
To contact the moderator:  [email protected]
------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/