After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 544650 - vino-server is not started when /desktop/gnome/remote_access/enabled is true
vino-server is not started when /desktop/gnome/remote_access/enabled is true
Status: RESOLVED FIXED
Product: vino
Classification: Applications
Component: Server
2.23.x
Other opensolaris
: Normal critical
: ---
Assigned To: Vino Maintainer(s)
Vino Maintainer(s)
: 544719 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-07-25 07:01 UTC by Halton Huo
Modified: 2008-08-11 11:28 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
autostart file for vino-server (290 bytes, text/plain)
2008-07-25 08:47 UTC, Halton Huo
  Details
patch for bug #544650, vino part (1.47 KB, patch)
2008-07-25 08:50 UTC, Halton Huo
none Details | Review
patch for bug #544650, vino part, set AutoRestart=true (1.47 KB, patch)
2008-08-07 08:08 UTC, Halton Huo
committed Details | Review

Description Halton Huo 2008-07-25 07:01:01 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?
Comment 1 Halton Huo 2008-07-25 07:15:33 UTC
I've checked the document on http://live.gnome.org/SessionManagement/NewGnomeSession. It seems vino need adapt the new change in gnome-session.
Comment 2 Halton Huo 2008-07-25 08:47:59 UTC
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.
Comment 3 Halton Huo 2008-07-25 08:50:02 UTC
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.
Comment 4 Jonh Wendell 2008-07-25 16:37:38 UTC
*** Bug 544719 has been marked as a duplicate of this bug. ***
Comment 5 Jonh Wendell 2008-07-25 16:41:32 UTC
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...
Comment 6 Li Yuan 2008-07-28 02:28:43 UTC
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?
Comment 7 Mark McLoughlin 2008-07-28 08:00:17 UTC
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
Comment 8 Halton Huo 2008-08-05 09:31:02 UTC
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? 

Comment 9 Jonh Wendell 2008-08-05 19:11:39 UTC
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.
Comment 10 Halton Huo 2008-08-06 02:58:47 UTC
(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. 
Comment 11 Li Yuan 2008-08-06 07:36:19 UTC
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?
Comment 12 Vincent Untz 2008-08-06 10:58:04 UTC
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.
Comment 13 Matthias Clasen 2008-08-06 13:34:10 UTC
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.
Comment 14 Vincent Untz 2008-08-06 13:40:56 UTC
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.
Comment 15 Matthias Clasen 2008-08-06 14:09:08 UTC
how do you think gnome-session should stop an arbitrary app when the key is toggled ? kill -9 ? 
Comment 16 Vincent Untz 2008-08-06 14:15:45 UTC
(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?
Comment 17 Matthias Clasen 2008-08-06 14:21:38 UTC
That only works for session clients, though...
Comment 18 William Jon McCann 2008-08-06 14:36:01 UTC
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?

Comment 19 Vincent Untz 2008-08-06 14:52:06 UTC
(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 :-)
Comment 20 William Jon McCann 2008-08-06 15:02:04 UTC
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.
Comment 21 Halton Huo 2008-08-07 02:35:24 UTC
I will try 2.23.6 then.
Comment 22 Halton Huo 2008-08-07 08:05:50 UTC
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.
Comment 23 Halton Huo 2008-08-07 08:08:49 UTC
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.
Comment 24 Halton Huo 2008-08-07 09:18:48 UTC
Two bugs are filed.
Bug #546747 is for issue 1)
Bug #546750 is for issue 2)
Comment 25 Jonh Wendell 2008-08-08 12:27:44 UTC
OK, Halton. Go ahead and commit this patch.

Let's track now gnome-session bugs.
Comment 26 Halton Huo 2008-08-11 03:18:13 UTC
patch committed.

Refer to William's comment in bug #546747, I s/Autostart-Condition/AutostartCondition.

Should this bug be marked as FIXED?
Comment 27 Jonh Wendell 2008-08-11 11:28:39 UTC
Marking as FIXED. We should track gnome-session bugs now.