Calling RegisterServiceProcess from setsid ?

Pierre A. Humblet
Wed Jun 4 03:43:00 GMT 2003

At 11:11 PM 6/3/2003 -0400, Christopher Faylor wrote:
>On Tue, Jun 03, 2003 at 10:47:22PM -0400, Pierre A. Humblet wrote:
>>At 10:17 PM 6/3/2003 -0400, Pierre A. Humblet wrote:
>>>At 10:03 PM 6/3/2003 -0400, Christopher Faylor wrote:
>>>>I like the idea but the problem of not logging out wouldn't be in
>>>>the service case as much as the non-service case, would it?
>>>I have tried that but it seems to have no effect. 
>>>That's easy to test: launch inetd from a shell on 9X (it calls
>>>RegisterServiceProcess) and then log off. In my experience it will 
>>>launch one of these irritating termination pop-ups. Someone should
>>>double check though.
>>It's more complicated. What I wrote is correct when the shell is
>>under rxvt. Otherwise inetd stays alive. Would that mean that
>>setsid leaves inetd connected to something when running from 
>I'm not sure what you tried since I wasn't suggesting anything.
>was just saying that a service would want to stay running after
>logoff but every use of setsid is not a service.  However, setsid
>would sort of imply that it should be long-running, too.

I thought that RegisterServiceProcess was not changing a program 
launched from the shell into a service, but only had effects on 
programs descending from those listed in the registry, under 
I now see that's incorrect, although, when launched from rxvt,
a program calling setsid and RegisterServiceProcess is not turned
into a service.

>I don't know what is specific to rxvt.  Maybe it's the @#(&!
>pty/FreeConsole stuff.

How do you debug that stuff? Running under gdb or strace seems 
to change many things.

Overall I agree with you that setsid does not imply service (although
I can't name any case) but that it would still be beneficial to call 
RegisterServiceProcess from setsid.


More information about the Cygwin-developers mailing list