[SSSD] [PATCH] monitor: create pid file after all responders are started

Jakub Hrozek jhrozek at redhat.com
Tue Oct 2 09:56:06 UTC 2012


On Tue, Oct 02, 2012 at 11:44:31AM +0200, Pavel Březina wrote:
> On 10/02/2012 11:18 AM, Jakub Hrozek wrote:
> >On Tue, Oct 02, 2012 at 11:05:19AM +0200, Pavel Březina wrote:
> >>>I wonder if the exit() is necessary? Would it be enough to just return
> >>>the error code and perhaps also from client_registration() ?
> >>
> >>When the pidfile was created in server_setup(), the monitor exited
> >>with 2, so I followed this scenario. But you are right. SSSD is
> >>fully functional at this point so we shouldn't exit it just because
> >>we where unable to create pidfile.
> >>
> >
> >Sorry, I think I confused you. I would prefer aborting becuse the initscripts
> >have no way to signal the SSSD to shut down, but in general I think that
> >using exit() from outside main() is not very nice. Is there a way to pass
> >the error code all the way up to the main loop and terminate the SSSD there?
> 
> Ah, no, it is called via D-Bus so there is no such way afaik.
> Patches with exit() are attached.
> 

What about sending a SIGTERM to itself with kill(getpid(), SIGTERM) ? I
think it's used elsewhere in the code as well..



More information about the sssd-devel mailing list