Le Wed, 10 Sep 2014 15:32:10 +0530,
Ritesh Raj Sarraf <[email protected]> a écrit :

> On Monday 01 September 2014 05:12 PM, Laurent Bigonville wrote:
> >> >Give me your thoughts here. The daemon gets started as the user
> >> >logs in. I think I made it follow some fdo xdg stuff. Is there
> >> >something similar for logout ??
> >> >daemon(0,0);
> > Are you sure that application started by xdg autostart can actually
> > fork? I've the feeling that gnome-session is loosing track of the
> > PID of the process (but this is a wild guess)
> 
> 
> I have no idea about desktops. That's why I asked you.
> 
> The other approach would be to do a check in within the daemon
> itself. It would mean walking down the /proc file system and look for
> the proc name. Ugly, but may work. May look at it in the future.

I tried removing the call to daemon(3), same issue.

Could be related to the use of system() command?

Quoting the system(3) manpage:

       As mentioned, system() ignores SIGINT and SIGQUIT.  This may make 
programs that call it from a loop uninterruptible, unless they take care 
themselves to check the exit  sta‐
       tus of the child.  For example:
           while (something) {
               int ret = system("foo");

               if (WIFSIGNALED(ret) &&
                   (WTERMSIG(ret) == SIGINT || WTERMSIG(ret) ==
               SIGQUIT)) break;
           }


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to