It should either work, or reply that is should not be run as root. Steps to Reproduce: # dnfdragora Traceback (most recent call last): File "/usr/bin/dnfdragora", line 47, in <module> import dnfdaemon.client File "/usr/lib/python3.5/site-packages/dnfdaemon/client/__init__.py", line 192, in <module> session = DBus(Gio.bus_get_sync(Gio.BusType.SESSION, None)) GLib.Error: g-io-error-quark: The connection is closed (18)
CC: (none) => ngompa13
Assignee: bugsquad => anaselli
hmm have you run it using "su" or "su -"?
ah yes... works OK when started in konsole after issuing "su -" but errs like above if hyphen not used. "sudo dnfdragora" also works OK.
The problem is described here: session = DBus(Gio.bus_get_sync(Gio.BusType.SESSION, None)) I'm not that expert there, but i think DBUS session is not available for root, that's why you need to run on a "login shell", dnfdragora is not the only one affected by that.
Resolution: (none) => INVALIDStatus: NEW => RESOLVED
Yes. You need to use a login shell that initializes a session, otherwise it doesn't work.
That is probably OK then, but could it be made to output some message that dudes like me understand? I am used to starting mcc after having issued "su" without hyphen
I'll check if i can trap the exception properly, but i cannot promise anything
Yeah it is not important, but could be beautiful :)
Affected line in dnfdaemon.client: https://github.com/manatools/dnfdaemon/blob/master/python/dnfdaemon/client/__init__.py#L192 i can get an exception when try importing the module, but don't know which so i can print out anything better, but the exception is however thrown, Neal any suggestion?
Well i tried to fix it as in https://github.com/manatools/dnfdragora/commit/06e1806edd92331ebb752dec15cb94a3498ef247 try using this https://raw.githubusercontent.com/manatools/dnfdragora/master/bin/dnfdragora instead of the official /usr/bin/dnfdragora to look if it could be ok for you (download it from the above URL and run it as "python3 dnfdragora" for instance)
bash-4.3$ su Lösenord: [root@svarten Ut]# python3 ./dnfdragora dnfdaemon client failure [g-io-error-quark: The connection is closed (18)] Try again using a login shell [root@svarten Ut]# So technically it works :) But could you (to help less shell literate people) extend the message to: " Try again using a login shell (login with "su -" or use sudo) "
It works if i log in using "su -" But if i log in with "su" like in previous comment, and then try using "su -" it think dnf is blocked: dnfdragora immediately show a pop up message (same is output in shell) and when user click OK it exits: dnfdaemon client error occurred: g-io-error-quark: GDBus.Error:org.baseurl.DnfSystem.LockedError: dnf is locked by another application (36) So it somehow locks dnf too early? (before deciding if it is OK to run)
on comment #11 sorry it works here, are you sure you've done anything else?
Test fresh: Even when only started after issuing "su -" the new version locks dnf, but the old version do not:: 0. rebooted, logged into plasma, opened Konsole. In it: 1. log in using "su -" 2. issue "python3 /usr/bin/dnfdragora". It works OK. close it. 3. again "python3 /usr/bin/dnfdragora". It works OK. close it. 4. issue "python3 /path/to/new/dnfdragora". It works OK. close it. 5. again "python3 /path/to/new/dnfdragora", result: "dnfdaemon client error: g-io-error-quark: GDBus.Error:org.baseurl.DnfSystem.LockedError: dnf is locked by another application (36)"
ok, i definitely understood why, the git version is a bit ahead and check also if dnfdragora ui is running before unlocking, the installed one not, so script without other core code does not unlock db. We wanted to have a better feed back and now we have it, so it works. Regarding the output string, i'll see, I'm not sure that is the only one error so i can write su -, but I'm not sure it works if you are in a ssh remote session though... if you wanted to test it... you're welcome :) BTW, to unlcok dbb you can use dnfdragora --exit (of course be aware that db is not really locked by another application)
OK thanks :) Yes "dnfdragora --exit" worked to unlock. I know it is hard to wite helpful hints that are exaxtly always working... Someone using ssh have better understanding of shell and can probably help herself. We casual home systems admins value a tip on "su -"
done https://github.com/manatools/dnfdragora/commit/f2318936df34c86d156985df99de669062402ce2