Is There A Way To Do This ... ???

Corné Beerse cbeerse "at"
Tue Apr 20 09:31:01 2004

Tennis Smith wrote:

> Hi,
> Is there a way to stop a users' VNC connection if a particular
> application is exited? We'd like to have users access Emacs on a VNC
> server. If the user exits Emacs, the connection itself would be
> terminated. 
> Can that be done?

Yes. IF you peek at the current/default .vnc/startup script, you see there 
starts `twm`, the window manager and `xterm`, just an application.

Roughly by head, it should be something like:

==== .vnc/startup ====
twm &
sleep 5

Note, there is an & after `twm` but NOT after `emacs`. This will start twm, wait 
5 seconds for twm to start (you can change or even remove this) and then start 
emacs. The script will wait until emacs finishes. Once the script finishes, the 
session will be ended.

If the end of the script does not end the session, then best to edit the 
`vncserver` script (call it `emacsserver`) to end the session after the end of 
the xstartup script.