Re: Run Daemon from my user interface



Thomas Keaney wrote:
> How would I run a daemon from my user interface?

you can use g_spawn_async to start your executable
and you can "terminate" it using the `kill' system call,
it is recommendable to try `SIGTERM' a few times before
using the more violent `SIGKILL' (this is what most systems
I know of do at shutdown time to stop daemon services).

Does it really have to be a daemon ?

> I want to run a program from within my interface and let this
> continue to run in the background until I terminate it by
> clicking on a button again from within my user interface.

You can spawn it, establish an IPC... and at termination time,
politly ask your application to quit, and then proceed with
waitpid() to reap your zombie (but I think that g_spawn_async
takes care of that for you).


Cheers,
                                   -Tristan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]