Hi.

In this week I did a small prototype of an application that I'm doing for linux with Lazarus. It open socket for remote visual control, mysql connections, and other nice things.

Now I'm going to abstract more all the classes and make things better... but before that I want to ask you some basics of linux service developing.

I saw that "famous" services like mysql and apache don't have a soft close function: in the init.d/mysql or apache script there are only "kill" commands that use sometimes the process name and sometimes the process id.

So my questions are...:
1) Does the kill on a linux service launch some "onkill" functions, or that's a kill-without-doing-anithing-else ? I'm thinking about using a soft close through the tcp connection with a command in the init.d/my_service stop like that:
telnect localhost myport /my_service_suicide

Are'nt there any ways to put some code into a "onkill" event of a linux process?

2) How do I configure threads in linux? I mean... I'd like to change their name and aspect like other services do, and keep under control their behaviour (state, resume call times, speed, cpu usage, ecc).

3) Does killing the main_unit (father) kills the processes? I tryed an example in wich I launch 2 thread before the main closes with the .end and they seem to "survive", but having the father alive can be useful to control purposes...

4) What does the fpfork command used in the "doing a service under linux" example on your wiki? I'm a bit confused about it's behaviour, cause doing an if block with (pid=0) on it makes the program do both the if and the else in the same time...

5) How can I access classes istances (or threads) created by their father from the different childs? I got a lot of recursive declaration errors trying to do that but I failed to access them with "self.father.class" like calls.

Thanks in advance,
Alvise

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to