Re: logout desktop session,process is not kill?



On Mon, Mar 30, 2009 at 10:47 PM, lovelinux <xiaoaojianghu_ai 163 com> wrote:
>
> I design a program.it's always loop until.
> for example
> #include <stdio.h>
> #include <stdlib.h>
> int main(int argc,char** argv)
> {
>    while(1)
>         sleep(1);
>   return 0;
> }
> User logout desktop session,again login desktop session,this process still
> exists but look like not run.
> When logout desktop session,which signal will be send to all process?

No Unix signals are sent.  If you want to tie your program's lifecycle
to the desktop, connect to to either the X server using xlib, or the
DBus session bus (using libdbus, or a binding such as dbus-glib).
Both will by default call exit() when their connection is closed.


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