Comment 16 for bug 275432

Revision history for this message
James Westby (james-w) wrote : Re: console-kit-daemon[13695]: CRITICAL: cannot initialize libpolkit

Hi,

Don't worry about testing, I think I've got it. If you were to perform that test
I think you would find that only installing policykit would fix it.

The problem appears to be this:

src/polkit/polkit-context.c has this:

                /* Watch the /etc/PolicyKit/PolicyKit.conf file */
                pk_context->inotify_config_wd = inotify_add_watch (pk_context->inotify_fd,
                                                                   PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf",
                                                                   IN_MODIFY | IN_CREATE | IN_ATTRIB);
                if (pk_context->inotify_config_wd < 0) {
                        polkit_debug ("failed to add watch on file '" PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf': %s",
                                   strerror (errno));
                        /* TODO: set error */
                        goto error;
                }

and similar for /var/lib/misc/Policykit.reload.

You can't set an inotify watch on a non-existent file, and these files
are shipped as part of the policykit package.

Therefore currently libpolkit2 requires files from the policykit file to operate,
but doesn't depend on the package.

The inotify_add_watch calls have IN_CREATE, hinting to me that it intends it
to work if they don't exist, but this doesn't have the intended effect. Therefore
I will report this issue upstream.

As well as fixing this in that fashion we can fix it in the packaging, at least
temporarily. However, I can't really think of a way of doing that that doesn't have
headaches.

I'll notify the server team of this.

Thanks,

James