Re: Run Daemon from my user interface



On Mon, 2004-03-08 at 17:04, Thomas Keaney wrote:
I want to read and write data to a file continuously so I guess it would
have to ba a daemon. Where could I get more info on this function? Cheers

Wouldn't you want to use threads for this since it will only run for as
long as your program is running for?

--
J5

Regards,
Thomas Keaney
4 CSSE

----- Original Message ----- 
From: "Tristan Van Berkom" <vantr touchtunes com>
To: "Thomas Keaney" <se40319 cs may ie>
Cc: <gtk-app-devel-list gnome org>
Sent: Monday, March 08, 2004 9:57 PM
Subject: 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



_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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