GNOME Bugzilla – Bug 546750
program won't stop when the gconf key is turn to false
Last modified: 2008-08-15 17:48:33 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
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.
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?
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
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?
(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
(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.
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.