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 546750 - program won't stop when the gconf key is turn to false
program won't stop when the gconf key is turn to false
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
git master
Other All
: Normal major
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-07 09:15 UTC by Halton Huo
Modified: 2008-08-15 17:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24



Description Halton Huo 2008-08-07 09:15:17 UTC
I'm using new gnome-session 2.23.6. Take vino for example:

With bug #544650 fixed, there is a vino-server.desktop file in
/usr/share/gnome/autostart.

How to reproduce
1) Start vino-preferences to enable vino
2) Use 'ps -ef|grep vino-server' to confirm vino-server is running
3) disable vino in vino-preferences
4) Use 'ps -ef|grep vino-server' to check whether vino-server is running

Expected result:
   vino-server stops

Actual result:
   vino-server is still running
Comment 1 Halton Huo 2008-08-07 09:17:32 UTC
If you do not have bug #544650 included, put vino-server.desktop under /usr/share/gnome/autostart is alos okay. You can get it from attachment of bug #546747.
Comment 2 William Jon McCann 2008-08-08 15:16:21 UTC
Quoting from what I said in bug 544650:

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 3 Lucas Rocha 2008-08-13 20:25:10 UTC
Halton, gnome-session needs to have a corresponding session client in order to stop an app when its condition changes. So, a simple solution would be to use the little program which is already in vino source tree[1]. You should just remove the restart style code (which now comes from the .desktop file) and the gconf key tracking code (as gnome-session does this for you now). Then, the vino-server .desktop file should reference this program in the Exec key. As the vino-session is a session client, it would start vino when it starts and kill vino when receiving a "die" XSMP message. That simple.

[1] http://svn.gnome.org/svn/vino/trunk/session/vino-session.c
Comment 4 Jonh Wendell 2008-08-13 20:35:58 UTC
The problem with this approach is:

- There will be always a program running (vino-session)
- It uses bonobo

So, I can write a d-bus interface to gnome-session in vino so that it could be a gnome-session client and thus gnome-session could restart it, if it crashes and stop it when gconf key becomes false.

I just need to know what I am supposed to do. Which d-bus methods should I write? Is there any doc somewhere?
Comment 5 Lucas Rocha 2008-08-13 21:17:59 UTC
(In reply to comment #4)
> The problem with this approach is:
> 
> - There will be always a program running (vino-session)
> - It uses bonobo

I agree it's not the ideal solution but it's the drawback of vino not being a session client right now. You don't necessarely have to use bonobo. You can just spawn vino on vino-session startup and kill the process when it receives a "die" XSMP message. This is the approach we're using for gnome-keyring now[1]. You could simply do the same for vino now. When the new D-Bus protocol is officially in place, we'll probably propose a mass migration of our whole stack to the new protocol, which involves migrating vino as well.

> So, I can write a d-bus interface to gnome-session in vino so that it could be
> a gnome-session client and thus gnome-session could restart it, if it crashes
> and stop it when gconf key becomes false.
> 
> I just need to know what I am supposed to do. Which d-bus methods should I
> write? Is there any doc somewhere?

I would not advice any app developer to start using the new D-Bus protocol just yet. Jon is still polishing and improving it very frequently. Plus, it's not an "official" protocol yet.

[1] http://svn.gnome.org/svn/gnome-session/trunk/compat/gnome-keyring-daemon-wrapper.c
Comment 6 William Jon McCann 2008-08-13 21:22:23 UTC
(In reply to comment #5)
> I would not advice any app developer to start using the new D-Bus protocol just
> yet. Jon is still polishing and improving it very frequently. Plus, it's not an
> "official" protocol yet.

Yeah, I'm not recommending that anyone use it yet.
Comment 7 William Jon McCann 2008-08-15 17:48:33 UTC
This should be fixed in trunk now.  If there is no client connected for an app, and the app is still running, it is signaled.