Re: [fpc-pascal] [SYSTEM] Linux processes when execute external program by a thread

2006-11-22 Thread Michael Van Canneyt


On Tue, 21 Nov 2006, TOUZEAU DAVID wrote:

> Dear
> 
> my application run has a daemon
> When the daemon load, it create a Timer function as a class(TThread).
> This Timer thread has a loop and create an another Thread (called "SendStatus"
> each 5 minutes)
> 
> function that load thread :
> ###
> procedure mTimer.Execute;
> var
>   Pool:integer;
>   xPool:longint;
>   Myini:TIniFile;
>   thread:SendStatus;
> begin
> 
> while not Terminated do
>  begin
> FConfigFilePath:='/etc/artica/artica-agent.conf';
> LoadSettings;
> xPool:=(Fpool*60)*1000;
> logs('mTimer.Execute->initilize pooling for ' + IntTostr(Fpool) + ' 
> milliseconds for each loop-> '+ IntTostr(Fpool) + ' minutes (from ' +
> FConfigFilePath + ')');
> LoadSettings;
> logs('mTimer.Execute->initilize Thread Sendstatus');
>  thread:=SendStatus.Create; //Creating the new thread
>  thread.Resume;//Executing the new thread
>  thread.free;//Terminate the new thread
>  logs('mTimer.Execute->kill Thread Sendstatus');
>
> if FMustReload=1 then begin
>Myini:=TIniFile.Create(FConfigFilePath);
>Myini.WriteInteger('ACTIONS','ReloadSettings',1);
>LoadSettings;
> xPool:=(Fpool*60)*1000;
> logs('mTimer.Execute->Reload settings -> initilize pooling for 
> ' + IntTostr(xPool) + ' milliseconds for each loop');
>MyIni.free;
> end;
> Sleep(xPool);
> 
>  end;
> end;
> ###
> 
> 
> The "SendStatus" execute sometimes an external program writen in fpc called
> "articacrypt".
> 
> the function just use Execl to execute external program
> ###
> procedure
> SendStatus.DeCryptFile(Frompath:string;ToPath:string;PassPharse:string;SETT:KLNetSettings);
>  var passphrase,commandline,Fbin_path:string;
>begin
>Fbin_path:=SETT.binaries_path;
>if Length(SETT.artica_crypt_key)=0 then begin
>   SETT.logs('SendStatus.artica_crypt_key -> null aborting..');
>   exit;
>end;
>commandline:=Fbin_path + '/articacrypt false ' + Frompath + ' ' +  
> ToPath + ' ' +  PassPharse;
> 
>Execl(commandline);
> 
>SETT.logs('SendStatus.DeCryptFile -> ' + ToPath + ' was process');
>exit;
> end;
> ###
> 
> this external program kill itself by calling halt() function at the end of the
> code.
> 
> 
> 
> My problem is that each execution  of this program will add  in the
> Linux system :
> 
> example of ps -aux :
> 
> root 25992  0.0  0.1  20500  2292 pts/0Sl   19:45   0:00
> /opt/artica/bin/articaagentd
> root 26008  0.0  0.0  0 0 pts/0Z19:45   0:00 [articacrypt]
> 
> root 26009  0.0  0.0  0 0 pts/0Z19:45   0:00 [articacrypt]
> 
> root 26010  0.0  0.0  0 0 pts/0Z19:45   0:00 [articacrypt]
> 
> root 26011  0.0  0.0  0 0 pts/0Z19:45   0:00 [articacrypt]
> 
> root 26012  0.0  0.0  0 0 pts/0Z19:45   0:00 [articacrypt]
> 
> root 26134  0.0  0.0  0 0 pts/0Z19:47   0:00 [articacrypt]
> 
> root 26135  0.0  0.0  0 0 pts/0Z19:47   0:00 [articacrypt]
> 
> root 26136  0.0  0.0  0 0 pts/0Z19:47   0:00 [articacrypt]
> 
> root 26137  0.0  0.0  0 0 pts/0Z19:47   0:00 [articacrypt]
> 
> root 26138  0.0  0.0  0 0 pts/0Z19:47   0:00 [articacrypt]
> 
> root 26247  0.0  0.0  0 0 pts/0Z19:49   0:00 [articacrypt]
> 
> root 26248  0.0  0.0  0 0 pts/0Z19:49   0:00 [articacrypt]
> 
> root 26249  0.0  0.0  0 0 pts/0Z19:49   0:00 [articacrypt]
> 
> root 26250  0.0  0.0  0 0 pts/0Z19:49   0:00 [articacrypt]
> 
> root 26251  0.0  0.0  0 0 pts/0Z19:49   0:00 [articacrypt]
> 
> root 26388  0.0  0.0  0 0 pts/0Z19:51   0:00 [articacrypt]
> 
> root 26389  0.0  0.0  0 0 pts/0Z19:51   0:00 [articacrypt]
> 
> root 26390  0.0  0.0  0 0 pts/0Z19:51   0:00 [articacrypt]
> 
> root 26391  0.0  0.0  0 0 pts/0Z19:51   0:00 [articacrypt]
> 
> root 26392  0.0  0.0  0 0 pts/0Z19:51   0:00 [articacrypt]
> 
> root 26511  0.0  0.0  0 0 pts/0Z19:53   0:00 [articacrypt]
> 
> root 26512  0.0  0.0  0 0 pts/0Z19:53   0:00 [articacrypt]
> 
> root 26513  0.0  0.0  0 0 pts/0Z19:53   0:00 [articacrypt]
> 
> root 26514  0.0  0.0  0 0 pts/0Z19:53   0:00 [articacrypt]
> 
> root 26515  0.0  0.0  0 0 pts/0Z19:53   0:00 [articacrypt]
> 
> root 26662  0.0  0.0  0 0 pts/0Z19:55   0:00 [articacrypt]
> 
> root 26663  0.0  0.0  0 0 pts/0Z19:55   0:00 [articacrypt]
> 
> root 26664  0

Re: [fpc-pascal] [SYSTEM] Linux processes when execute external program by a thread

2006-11-22 Thread Michael Van Canneyt


On Tue, 21 Nov 2006, Marco van de Voort wrote:

>  
> > this external program kill itself by calling halt() function at the end 
> > of the code.
> > My problem is that each execution  of this program will add  in 
> > the Linux system :
> > 
> > Please how to clean theses "defunct"  on the system...??
> 
> Don't use execl but sysutils.executeprocess.
> 
> (fp)execl is an internal function that requires a lot of special
> borderconditions, one of it being called after a fork, and another that the
> mainprogram must wait for it.

ExecProcess waits for the child process to exit.
This does not help him, as I assume the process needs to run asynchronously ?

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Web site now translatable

2006-11-22 Thread Marco Ciampa
On Sun, Nov 19, 2006 at 03:33:47PM +0100, Daniël Mantione wrote:
> Hello,
> 
> Over the weekend we have started to use a new website build tool. The main 
> improvement is support for a multi-lingual website.
The translatable site is simply worderful.

Many many thanks! 

-- 

Marco Ciampa

++
| Linux User  #78271 |
| FSFE fellow   #364 |
++
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] CDROM handling again

2006-11-22 Thread Marc Weustink
Felipe Monteiro de Carvalho wrote:
> On 11/21/06, Pianoman <[EMAIL PROTECTED]> wrote:
>> Hello, I 'd like to do it under win32. Michael mentioned way under
>> linux if
>> someone knows sometihing similar for win32 let me know.
>> Thanx in advance
> 
> I don´t think there was any need to start a new thread, 

FYI, When receiving messages as digest, one cannot keep the same thread.

Marc


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal