! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfrun daemon doesn't have a full environment when started from dbus
Status:
RESOLVED: FIXED
Product:
Xfce-utils

Comments

Description Yves-Alexis Perez editbugs 2010-12-07 19:40:20 CET
Ok, I'll try to summarize what I've seen.

* When compiled with dbus support, xfrun adds a dbus service org.xfce.RunDialog.
* When called, xfrun sends a dbus command OpenDialog to org.xfce.RunDialog
* if xfrun4 is already running
** it receives the message and display the run dialog
** one type a command
** the command gets executed with the environment of the xfrun daemon
* else
** dbus sees that a message to org.xfce.RunDialog is sent and there's no receiver
** dbus runs the service using the Exec= line (which is xfrun4 --daemon)
** the xfrun4 daemon is run from dbus
** the xfrun4 daemon receives the OpenDialog command
** the xfrun4 daemon displays the run dialog
** one types a command
** the command gets executed with the environment of the xfrun daemon

In the latter case, the environment is the one from dbus, which is started *before* anything else in the session, and especially before the session manager. Which means the xfrun daemon is not aware of the session management, and so anything run from it won't be registered in the session.

I'm not too sure how to fix that. The fact that sending a dbus message is enough to run the daemon and show the popup is nice, that means we don't have to have the daemon running at all time. But that means we won't be able to register anything to the session, unless there's a way to “pass” the environment to the dbus process.

As the daemon doesn't time out anyway, it might be a good idea to start it as part of the session, so it gets the correct environment variable

Regards,
-- 
Yves-Alexis
Comment 1 Nick Schermer editbugs 2010-12-08 09:25:09 CET
We could easily send a copy of the instance's envp to the daemon, that might also be the best solution since it will always pick up the latest changes.
Comment 2 Yves-Alexis Perez editbugs 2010-12-08 10:48:44 CET
(In reply to comment #1)
> We could easily send a copy of the instance's envp to the daemon, that might
> also be the best solution since it will always pick up the latest changes.

Oh yes, that's quite sensible too. It's not too large to be sent on the bus? Nor to sensitive?
Comment 3 Nick Schermer editbugs 2010-12-08 11:01:19 CET
Nah you won't notice the slowdown, not that many strings.
Comment 4 Nick Schermer editbugs 2010-12-08 20:20:12 CET
Created attachment 3253 
send environ over dbus

Could you try the attached patch?
Comment 5 Yves-Alexis Perez editbugs 2010-12-09 11:48:43 CET
(In reply to comment #4)
> Created attachment 3253 
> send environ over dbus
> 
> Could you try the attached patch?

Didn't you forgot to initialize envp in xfrun_show_dialog()?
Comment 6 Nick Schermer editbugs 2010-12-09 12:02:11 CET
Created attachment 3257 
Another try

Argh, yeah stupid, I changed the environ detect in the last minute and swapped the calls. This patch should be correct.
Comment 7 Nick Schermer editbugs 2010-12-09 12:06:41 CET
Should also fix the environment typo in the function name when I apply the patch.
Comment 8 Yves-Alexis Perez editbugs 2010-12-09 13:32:00 CET
Works fine. Which typo?
Comment 9 Nick Schermer editbugs 2010-12-09 19:42:24 CET
Applied in 32f1bfe.
Comment 10 Nick Schermer editbugs 2011-06-17 20:33:50 CEST
*** Bug 6178 has been marked as a duplicate of this bug. ***

Bug #6927

Reported by:
Yves-Alexis Perez
Reported on: 2010-12-07
Last modified on: 2011-06-17
Duplicates (1):
  • 6178 xfrun4 doesn't inherit env and breaks ibus/input methods

People

Assignee:
Nick Schermer
CC List:
3 users

Version

Attachments

send environ over dbus (5.50 KB, patch)
2010-12-08 20:20 CET , Nick Schermer
no flags
Another try (5.50 KB, patch)
2010-12-09 12:02 CET , Nick Schermer
no flags

Additional information