LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 02-18-2005, 07:24 PM   #1
the_reen
LQ Newbie
 
Registered: Jul 2004
Location: Poland
Distribution: SuSE 9.2 Professional
Posts: 22

Rep: Reputation: 15
Starting VNCserver on screen #1 everytime - HELP plz :)


Hello!

I have problem with starting Vncserver in my SuSE 9.2 distribution on the same screen after reboot or power down.

The problem is in file that vncserver makes on launch, in tmp directory (/tmp/.X11-unix). When the file is there, I can't run vncserver on the same screen number, vnc automatically launches on the next one.

How can I override it that everytime I start vnc it will run on the same screen, for example #1? Maybe delete the file before launch? Any other way?
 
Old 02-19-2005, 04:51 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
how are you controlling the stopping and starting? if you're manually starting it in an informal script and then just shutting down without stop VNC, then naturally that lock file won't be taken care off. if you don't already have one, i'd suggest creating an rc.d script to both stop and start the service. with a stop of the service on close the file should be cleanly removed. alternatively ( or additionally) you can modify the startup script to run an rm on the potential lock file before runnign vncserver.

if you've not made a startup sctrip before, it's normally quite easy. just find an existing on in /etc/init.d/rc.d or a similar location on your system that is very basic, and copy and alter a few lines to suit.
 
Old 02-19-2005, 08:38 PM   #3
the_reen
LQ Newbie
 
Registered: Jul 2004
Location: Poland
Distribution: SuSE 9.2 Professional
Posts: 22

Original Poster
Rep: Reputation: 15
Hey, thx for quick help.

I'm running the vncserver via vnc script (/var/bin/X11/vncserver), looks like I see the problem in it:

Code:
# If the unix domain socket exists then use that (DISPLAY=:n) otherwise use
# TCP (DISPLAY=host:n)

if (-e "/tmp/.X11-unix/X$displayNumber") {
    $ENV{DISPLAY}= ":$displayNumber";
} else {
    $ENV{DISPLAY}= "$host:$displayNumber";
}
$ENV{VNCDESKTOP}= $desktopName;

system("$xstartup >> " . &quotedString($desktopLog) . " 2>&1 &");

exit;
Can I delete this part?

Last edited by the_reen; 02-19-2005 at 08:40 PM.
 
Old 02-19-2005, 08:44 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
well no, as that's the official controlling script, after all, that lockfile is there for a reason. it's not unreasonable to blindly try to delete the file on a boot, as clearly it won't already be running, but editing the actual vncserver wrapper script isn't a great idea.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting vncserver mickeyboa Fedora 3 08-08-2005 03:47 AM
Trouble starting vncserver maximyus Linux - Networking 3 04-02-2005 01:49 PM
vncserver problems starting Xris718 Linux - General 2 10-09-2004 12:53 AM
Starting VNCserver on Mandrake 10.0 archange Linux - Newbie 1 10-01-2004 09:14 PM
Problem starting vncserver bunghole Linux - Networking 2 10-29-2001 04:53 AM


All times are GMT -5. The time now is 10:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration