GNOME Bugzilla – Bug 544650
vino-server is not started when /desktop/gnome/remote_access/enabled is true
Last modified: 2008-08-11 11:28:39 UTC
I notice from gnome-session 2.23.1 gsm-remote-desktop.c and gsm-remote-desktop.h are removed from code base. This will cause vino-server will not start when /desktop/gnome/remote_access/enabled is turned to true. This is a regression. Any intent for this deletion?
I've checked the document on http://live.gnome.org/SessionManagement/NewGnomeSession. It seems vino need adapt the new change in gnome-session.
Created attachment 115230 [details] autostart file for vino-server I put the vino-server.desktop to /usr/share/gnome/autostart If I "gconftool-2 -s /desktop/gnome/remote_access/enabled -t bool true", log out and in, the vino-server can be started. If I "gconftool-2 -s /desktop/gnome/remote_access/enabled -t bool false", log out and in, and then "gconftool-2 -s /desktop/gnome/remote_access/enabled -t bool true", vino-server is not started. Seems this is gnome-session bug. So I think to fix this bug, we need change both in vino and gnome-session.
Created attachment 115231 [details] [review] patch for bug #544650, vino part This is patch in vino part. It is simply add .desktop file to /usr/share/gnome/autostart.
*** Bug 544719 has been marked as a duplicate of this bug. ***
Halton, where does the key "X-GNOME-AutoRestart" come from? I haven't found it anywhere... I'm not sure how gnome-session will handle the life time of vino. Will it monitor vino, detect when is crashes and restart it? Perhaps we should add some d-bus interface to vino... I have to talk with new gnome-session developers...
I can find this in gnome-keyring-daemon-wrapper.desktop although I'm not sure what it is for. The problem is when we change /desktop/gnome/remote_access/enabled from false to true after login, vino-server isn't started (after applying halton's patch). I'm not familiar with the logic in gnome-session. Is there more thing vino need to do to let gnome-session start vino-server when the gconf key changes?
The patch looks about right to me ... Vincent: you're right that gnome-session won't restart vino-server if it dies, but that just means we need to add the restart feature to gnome-session if we feel it's important - it doesn't affect whether this patch should go in See gnome-session-manager/gsm-service.c:gsm_service_respawn() for how I did the respawn stuff before
John, is Li's explanation, is the patch for vino okay to commit? (In reply to comment #5) > Halton, where does the key "X-GNOME-AutoRestart" come from? I haven't found it > anywhere... > > I'm not sure how gnome-session will handle the life time of vino. Will it > monitor vino, detect when is crashes and restart it? Perhaps we should add some > d-bus interface to vino... > > I have to talk with new gnome-session developers... Any update on that?
Halton, have you tested vino with that desktop file in a gnome 2.23 environment? Does it work as expected? What happens if you run 'killall vino-server' while vino is enabled? Is it restarted automatically? I'm asking those questions because I'm running gnome 2.22, so I can't test your patch. Hopefully I'll upgrade to ubuntu intrepid next week so I can try it by myself.
(In reply to comment #9) > Halton, have you tested vino with that desktop file in a gnome 2.23 > environment? Yes, I'm under gnome 2.23. > Does it work as expected? Yes, when vino is enabled. vino-server starts at login time. But when you enable vino after you login gnome, vino-server won't start. That what I say work in gnome-session. > > What happens if you run 'killall vino-server' while vino is enabled? Is it > restarted automatically? No, vino-server won't start. Does vino has this feature before? If so, I think something should be done in gnome-session. > > I'm asking those questions because I'm running gnome 2.22, so I can't test your > patch. Hopefully I'll upgrade to ubuntu intrepid next week so I can try it by > myself. My understanding for this .desktop is gnome-session know how to start vino-server. It is enough for vino side. Other part should be in gnome-session. Correct me if I'm wrong.
Hi Vincent, After applying the patch, seems there is still no one listening the gconf key change (enable vino in vino-preference, vino-server is not started). Is this a bug for gnome-session or there is still something need to be done in vino besides the patch?
Sounds like a bug in gnome-session. It probably only looks at the key during login and doesn't monitor it, but I didn't check.
From my understanding the gnome-session autostart stuff works by looking at the gconf key at session start to decide whether to autostart or not. It doesn't mean that gnome-session is going to monitor the key during the lifetime of the session. If you put an AutoRestart=true, then gnome-session would restart the server if it crashes or otherwise goes away (but that only works for session clients, so the vino server would have to become session-managed). The alternative is do something similar to markmc's old vino-session approach: a simple session client that manages the server lifecycle and monitors the gconf key.
Matthias: but then it means that all autostart programs that are controled by a gconf key need an additional helper. Sounds suboptimal to me. gnome-session could do it itself, or ship a small client that handles it for all such programs.
how do you think gnome-session should stop an arbitrary app when the key is toggled ? kill -9 ?
(In reply to comment #15) > how do you think gnome-session should stop an arbitrary app when the key is > toggled ? kill -9 ? With the new dbus protocol?
That only works for session clients, though...
There were some bugs in gnome-session that prevented this from working. However, it should work fine in 2.23.6 - at least for starting vino. As for stopping, we have a few options and they aren't necessarily mutually exclusive. 1. The application can quit on its own in response to the gconf key turning false 2. If there is a client for the app: gsm_client_stop() XSMP die or D-Bus Stop 3. If there is a running app: gsm_app_stop() kill SIGTERM?
(In reply to comment #18) > There were some bugs in gnome-session that prevented this from working. > However, it should work fine in 2.23.6 - at least for starting vino. Is this only for autostart at login? Or during the whole session lifetime? Eg, the user can enable vino after logging in and the user certainly doesn't want to log out and log in again to have it started :-)
As of 2.23.6 we monitor the gconf key so it should work at any time during the session lifecycle. I just tested it again to make sure it works. If it isn't working that is a bug.
I will try 2.23.6 then.
I try gnome-session 2.23.6, vino-server can start during session lifecycle. There two issues left here: 1) When I change X-GNOME-AutoRestart=true in vino-server.desktop, and 'pkill vino-server', vino-server won't restart. 2) When I set /desktop/gnome/remote_access/enabled to false, vino-server won't stop. Just like you guys discussed. These two are separate with this bug, should report another two for them. So I'd say when the patch for vino part is committed, this bug is fixed.
Created attachment 116035 [details] [review] patch for bug #544650, vino part, set AutoRestart=true Compared with previous patch, only difference is set X-GNOME-AutoRestart=true.
Two bugs are filed. Bug #546747 is for issue 1) Bug #546750 is for issue 2)
OK, Halton. Go ahead and commit this patch. Let's track now gnome-session bugs.
patch committed. Refer to William's comment in bug #546747, I s/Autostart-Condition/AutostartCondition. Should this bug be marked as FIXED?
Marking as FIXED. We should track gnome-session bugs now.