| Red Hat This forum is for the discussion of Red Hat Linux. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
06-10-2009, 08:27 PM
|
#1
|
|
LQ Newbie
Registered: Apr 2008
Distribution: RHEL, Fedora, Ubuntu
Posts: 13
Rep:
|
How to get vncserver (Xvnc) and its apps to survive logout nicely???? [RHEL 5.1]
Using RHEL 5.1, I would like to login as a regular user, launch vncserver (which seems to be a perl frontend for Xvnc), use vncviewer to launch apps, quit the vncviewer, and logout with all the apps and vncserver running. And then (the part that I haven't made work yet), login as the same user, launch vncviewer and see exactly what I left before logging out.
Using a specially crafted ~/.vnc/xstartup (with a bunch of nohup's), I was able to keep apps running after logout. However, after logging back in and using vncviewer, there is only a blank screen without even a window manager. ps shows that the processes are running and the servers launched within vnc still respond correctly ... I just can't see the GUIs now. I thought that's what vnc would do for me.
Do the launched apps "forget" what X11 server they are using? Is the Xvnc X11 server somehow different after logout/login? Any solutions/recommendations?
[Update to clarify with example]
Here's what I want ...
1. Graphical login as normal user on RHEL 5.1
2. launch Xvnc via vncserver
3. run vncviewer and within its X11 window launch GUI apps (e.g., wireshark, xcalc, etc.)
4. quit vncviewer (no Xvnc logout, etc., just vncviewer quit)
5. logout of original login from step 1.
6. sometime later, graphical login as same normal user on RHEL 5.1 (as in step 1)
7. run vncviewer and see exactly what was present just before step 4.
In addition, everything launched in step 3 continues to run normally regardless of whether vncviewer is running (or not) and regardless of whether normal user is logged in (or not).
The killer seems to be step 5, but surely there is a workaround.
Last edited by rickhg12hs; 06-11-2009 at 10:12 PM.
Reason: clarify, provide example
|
|
|
|
06-11-2009, 07:56 AM
|
#2
|
|
Senior Member
Registered: Feb 2003
Location: CT
Distribution: Debian PPC/i386/AMD64 5.0(Lenny), Vista, XP , WIN7, Server 03/08
Posts: 1,270
Rep:
|
Well what you are logging out of is the Desktop environment and/or windows manager that the Xserver presents to you after you start it. Unlike console access when you logout VNC viewer does not go to like a login screen, it leaves the xserver window up with nothing running. In order to do what you want or that it seems you want, you will need to just disconnect from the VNC session, not log of. Or (I have never tried this) maybe you could get the vncserver to run xdm, gdm or kdm and then when you initially connected to the vncserver you would see a user logon, you then log on and then when you logoff the vnc server goes back to the user logon screen. (I have seen this done in tutorials before but it has been a long time)
|
|
|
|
06-12-2009, 07:52 PM
|
#3
|
|
LQ Newbie
Registered: Apr 2008
Distribution: RHEL, Fedora, Ubuntu
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by scheidel21
... In order to do what you want or that it seems you want, you will need to just disconnect from the VNC session, not log of.
|
Yes, you are right. I was doing this, but apparently more is required to nicely survive the original login/logout.
I've updated the original post/question to hopefully make the goal (and problem) clearer. Please post any new ideas. Thanks!
|
|
|
|
06-12-2009, 10:32 PM
|
#4
|
|
Senior Member
Registered: Feb 2003
Location: CT
Distribution: Debian PPC/i386/AMD64 5.0(Lenny), Vista, XP , WIN7, Server 03/08
Posts: 1,270
Rep:
|
start the vncserver session with a nohup signal that should keep it running even if the parent process is exited.
|
|
|
|
06-13-2009, 08:06 PM
|
#5
|
|
LQ Newbie
Registered: Apr 2008
Distribution: RHEL, Fedora, Ubuntu
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by scheidel21
start the vncserver session with a nohup signal that should keep it running even if the parent process is exited.
|
Actually, vncserver is a perl script that launches Xvnc. I copied the script to a local dir and modified it so that Xvnc is launched with nohup. It does continue to run after logout, however after logging back in and launching vncviewer, it shows just a blank screen without even a window manager.
Something must change with the logout/login such that the X11 apps and/or vncviewer don't know that they are associated.
|
|
|
|
06-13-2009, 08:11 PM
|
#6
|
|
LQ Newbie
Registered: Apr 2008
Distribution: RHEL, Fedora, Ubuntu
Posts: 13
Original Poster
Rep:
|
How to get vncserver (Xvnc) and its apps to survive logout nicely???? [RHEL 5.1]
Using RHEL 5.1, I would like to login as a regular user, launch vncserver (which seems to be a perl frontend for Xvnc), use vncviewer to launch apps, quit the vncviewer, and logout with all the apps and vncserver running. And then (the part that I haven't made work yet), login as the same user, launch vncviewer and see exactly what I left before logging out.
Using a specially crafted ~/.vnc/xstartup (with a bunch of nohup's), I was able to keep apps running after logout. However, after logging back in and using vncviewer, there is only a blank screen without even a window manager. ps shows that the processes are running and the servers launched within vnc still respond correctly ... I just can't see the GUIs now. I thought that's what vnc would do for me.
Do the launched apps "forget" what X11 server they are using? Is the Xvnc X11 server somehow different after logout/login? Any solutions/recommendations?
[Update to clarify with example]
Here's what I want ...
1. Graphical login as normal user on RHEL 5.1
2. launch Xvnc via vncserver
3. run vncviewer and within its X11 window launch GUI apps (e.g., wireshark, xcalc, etc.)
4. quit vncviewer (no Xvnc logout, etc., just vncviewer quit)
5. logout of original login from step 1.
6. sometime later, graphical login as same normal user on RHEL 5.1 (as in step 1)
7. run vncviewer and see exactly what was present just before step 4.
In addition, everything launched in step 3 continues to run normally regardless of whether vncviewer is running (or not) and regardless of whether normal user is logged in (or not).
The killer seems to be step 5, but surely there is a workaround.
|
|
|
|
06-13-2009, 09:57 PM
|
#7
|
|
Senior Member
Registered: Feb 2003
Location: CT
Distribution: Debian PPC/i386/AMD64 5.0(Lenny), Vista, XP , WIN7, Server 03/08
Posts: 1,270
Rep:
|
If you run ps -aux or pstree after logging out of your intial session do you see everything running that you left running?
|
|
|
|
06-14-2009, 10:49 AM
|
#8
|
|
Moderator
Registered: May 2001
Posts: 24,805
|
In /etc/sysconfig/vncserver edit VNCSERVERS="1:$USERNAME" and replace USERNAME with any valid unprivileged accountname. Login to the USERNAME account, run 'vncpasswd', log out. Run 'service vncserver start' to see if it works OK. Login to your own account and run vncviewer, provide the password set by running vncpasswd from USERNAMEs account and you're in $USERNAME's session without futher login. Now logging out of $USERNAME's KDE/GNOME/XFCE/whatever else session will close the session but just pressing F8 will only close vncviewer. Logging out of your account, logging back in and running vncviewer should get you back to $USERNAME's session with everything still running.
|
|
|
|
06-14-2009, 10:54 AM
|
#9
|
|
LQ Newbie
Registered: Apr 2008
Distribution: RHEL, Fedora, Ubuntu
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by scheidel21
If you run ps -aux or pstree after logging out of your intial session do you see everything running that you left running?
|
Yes
|
|
|
|
06-14-2009, 10:59 AM
|
#10
|
|
LQ Newbie
Registered: Apr 2008
Distribution: RHEL, Fedora, Ubuntu
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by unSpawn
In /etc/sysconfig/vncserver edit VNCSERVERS="1:$USERNAME" and replace USERNAME with any valid unprivileged accountname. Login to the USERNAME account, run 'vncpasswd', log out. Run 'service vncserver start' to see if it works OK. Login to your own account and run vncviewer, provide the password set by running vncpasswd from USERNAMEs account and you're in $USERNAME's session without futher login. Now logging out of $USERNAME's KDE/GNOME/XFCE/whatever else session will close the session but just pressing F8 will only close vncviewer. Logging out of your account, logging back in and running vncviewer should get you back to $USERNAME's session with everything still running.
|
This sounds like what I was looking for. I'll give it a go tomorrow. Thanks!
|
|
|
|
06-14-2009, 11:53 AM
|
#11
|
|
Moderator
Registered: May 2001
Posts: 24,805
|
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is temporarily closed awaiting merge with duplicate http://www.linuxquestions.org/questi...el-5.1-732086/.
|
|
|
|
06-14-2009, 01:02 PM
|
#12
|
|
Guru
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,002
|
On my server, I have this line in /etc/rc.local just before the final exit 0
Code:
su - tred -c " cd /home/tred && vncserver :1 -geometry 1024x768 -depth 24"
You will have to change the red bits for your username.
It starts a vncserver on display :1 as myself ( tred ) at boot time.
I can connect to it with
When I am finished, I just close the vnc window. I can then reconnect at any time, and the :1 desktop on the server is as I left it.
HTH
|
|
|
|
06-17-2009, 04:54 PM
|
#13
|
|
LQ Newbie
Registered: Apr 2008
Distribution: RHEL, Fedora, Ubuntu
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by rickhg12hs
This sounds like what I was looking for. I'll give it a go tomorrow. Thanks!
|
Worked great! Thanks!
BTW, this solution appears to be the "redhat way" of what senior member tredegar suggested in the other thread I started (and was reminded not to do anymore!!!!).
http://www.linuxquestions.org/questi...96#post3573596
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:07 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|