Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 12-08-2002, 06:31 PM   #1
LQ Newbie
Registered: Dec 2002
Posts: 8

Rep: Reputation: 0
Question auto execution script

hi, I'm really new with linux
(I installed RedHat 7.3 yesterday)

I have a linux server without screen or keyboard,
and I control it using vncserver.
I would like to start vncserver automatically when the server
starts, without having to plug any screen or keyboard on it.

I would like to do something like this :

su user1
vncserver &

su user2
vncserver &

in order to have two servers, one for each user.

I've read that I should write it in etc/rd.local.
I tried but it didn't work, it seems that only 'su user1' had been

Thanks for your help !
Old 12-08-2002, 11:37 PM   #2
Registered: May 2002
Posts: 172

Rep: Reputation: 30
try to chmod 700 ./scriptfile and then try to execute it ./scriptfile

good luck
Old 12-09-2002, 03:20 PM   #3
Registered: Dec 2002
Posts: 327

Rep: Reputation: 30
Um.. I'm not sure it's a scriptfile he's having a problem with. vnc comes as a package in Redhat (compiled binary) and all set up to go.

It does however, require a bit of reading of the manual.

I'm not sure why you're su'ing to various users.

However, man vncserver says this :

The display number to use. If omitted, the next free display number is used.

so, you can do this in your startup script :

vncserver :1
vncserver :2

Looking further I see a file /etc/sysconfig/vncservers :

# The VNCSERVERS variable is a list of display:user pairs.
# Uncomment the line below to start a VNC server on display :1
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <URL:>.

# VNCSERVERS="1:myusername"

One would imagine you'd need to set up your displays like :


and man vncpasswd.

Looking at your script, and looking at how the above works it seems like you're running the same instance of a single vnc server twice... the first will be replaced with the second...

Looking at 'man vncpasswd' I can see why you're su'ing to two different users. Perhaps you could set up a file to store your passwords make it root writable and have both passwords in the same place.



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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
script execution on halt linuxhippy Slackware 4 04-01-2005 07:09 PM
script execution error linux_lover2005 Programming 3 12-22-2004 06:46 AM
script execution Johng Programming 2 08-21-2004 04:58 PM
Speeding up Shell Script execution?? funkymunky Programming 8 07-16-2004 08:39 PM
auto-completion - how does it work & can my script args auto-complete? BrianK Programming 1 06-11-2004 04:51 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:29 AM.

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