polkit does not start

Stephane Russell srussell at prodigeinfo.qc.ca
Sun Jan 11 16:46:23 PST 2015


In my last post, please disregard errors in the
com.mycompany.Test1.conf, I reported it in a generic way and made errors
that were not in the original version (using com.company and
com.mycompany). Sorry for that.

Cheers,

SR

karu.pruun a écrit :
> That's interesting---I wonder if you could tell me what research you
> did on dbus and polkit. I would be interested in trying to make it
> work. Here's what I've found so far.
>
> I figured out that consolekit and hald are fine, it's polkit that
> messes up. Dbus cannot spawn it, and the problem is not dbus, it's
> polkit. Since I know almost nothing about dbus and friends my approach
> has been to compare with FreeBSD, where it's working fine, and try to
> isolate the piece of code where polkit on DragonFly deviates from the
> behavior seen on FreeBSD. I ran ktrace on polkit and the deviation
> from FreeBSD happens on the second attempt (type: AUTH EXTERNAL) of
> authentication:
>
> ---FreeBSD (successful)---
>   1579 polkitd  CALL  sendto(0x5,0x803076280,0x12,0x20000<MSG_NOSIGNAL>,0,0)
>   1579 polkitd  GIO   fd 5 wrote 18 bytes
>        "AUTH EXTERNAL 30\r
>        "
>   1579 polkitd  RET   sendto 18/0x12
>   . . .
>
>   1579 polkitd  CALL  recvfrom(0x5,0x80310f000,0x1000,0,0,0)
>   1579 polkitd  GIO   fd 5 read 37 bytes
>        "OK 42dd72d3f9cfe49615fb1f2154aabce1\r
>        "
>   1579 polkitd  RET   recvfrom 37/0x25
> --- ---
>
> vs
>
> ---DragonFly---
> 16116:1     0 polkitd  0.000006 CALL
> sendto(0x5,0x800740280,0x24,MSG_NOSIGNAL,0,0)
> 16116:1     0 polkitd  0.000010 GIO   fd 5 wrote 36 bytes
>        "AUTH EXTERNAL 34323934393637323935\r
>        "
> 16116:1     0 polkitd  0.000006 RET   sendto 36/0x24
> . . .
>
> 16116:1     0 polkitd  0.000520 CALL  recvfrom(0x5,0x800735000,0x1000,0,0,0)
> 16116:1     0 polkitd  0.000013 GIO   fd 5 read 46 bytes
>        "REJECTED EXTERNAL DBUS_COOKIE_SHA1 ANONYMOUS\r
>        "
> 16116:1     0 polkitd  0.000005 RET   recvfrom 46/0x2e
> --- ---
>
> The challenge is to find out why DragonFly computes
> '34323934393637323935' for the argument of AUTH EXTERNAL while FreeBSD
> does '30'. However, I haven't been able to identify the piece of code
> in polkit (and glib-2.0) where that particular call above to sendto()
> occurs.
>
> I compiled polkit and glib with gdb symbols but it seems I might need
> more symbols in perhaps other libraries? In any case, so far the call
> to sendto() seems to occur in a piece of code that I can't step in.
> I'll keep looking.
>
> Cheers
>
> Peeter
>
> --
>
>
> On Thu, Jan 8, 2015 at 7:45 PM,  <srussell at prodigeinfo.qc.ca> wrote:
>> I had the same problem and had to give up. Dbus logs are saying that no
>> valid external protocols were found.
>>
>> REJECTED EXTERNAL DBUS_COOKIE_SHA1 ANONYMOUS
>>
>> 498557: [dbus-auth.c(1704):handle_auth] server: Trying mechanism EXTERNAL
>> 498557: [dbus-auth.c(1624):process_data] server: data: '4294967295'
>> 498557: [dbus-auth.c(1026):handle_server_data_external_mech] server: no
>> credentials, mechanism EXTERNAL can't authenticate
>> 498557: [dbus-auth.c(430):shutdown_mech] server: Shutting down mechanism
>> EXTERNAL
>>
>> It happens only for the system dbus. I made some reseach and it occurs when
>> dbus is trying to reserve the name of a service. Gio returns:
>>
>> Lost the name [...] on session bus.
>>
>> I verified the pam confiruration and it looked ok.
>>
>> Overall:
>> -upowerd crashes
>> -ConsoleKit can't make a session active
>> -X login is freezing a minute or two
>> -The session menu of xfce is freezing also for some time
>> -any logoff from xfve is freezing temporarilly and leaves some applications
>> opened.
>>
>> I spent a lot of time trying to figure out the problem, but I had to give
>> up. My workaround was to disable the global dbus service. Dbus is still
>> available for applications, but I think that dports is disabling it for
>> applications as well, when possible.
>>
>> SR
>>
>>
>> Le 2015-01-08 10:50, karu.pruun a écrit :
>>
>>
>>     Hello
>>
>>     I seem to have troubles getting polkit working. I have in /etc/rc.conf
>>
>>     ---/etc/rc.conf---
>>     hald_enable="YES"
>>     dbus_enable="YES"
>>     --- ---
>>
>>     and this combination results in dbus, hald and consolekit services
>>     running, but polkitd fails
>>
>>     ---/var/log/messages---
>>     Jan  8 17:42:55 dfly dbus[984]: [system] Activating service
>>     name='org.freedesktop.ConsoleKit' (using servicehelper)
>>     Jan  8 17:42:55 dfly console-kit-daemon[1010]: WARNING:
>>     polkit_authority_get: Error getting authority: Error initializing
>>     authority: Exhausted all available authentication mechanisms (tried:
>>     EXTERNAL, DBUS_COOKIE_SHA1, ANONYMOUS) (available: EXTERNAL,
>>     DBUS_COOKIE_SHA1, ANONYMOUS)
>>     --- ---
>>
>>     I ran a quick test on a FreeBSD virtual machine, the above two lines
>>     in rc.conf start dbus, hald, consolekit and polkitd and all seems
>>     fine. I wonder if I've missed anything on DragonFly?
>>
>>     Cheers
>>
>>     Peeter
>>
>>     --
>>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20150111/efc142f4/attachment-0008.bin>


More information about the Users mailing list