LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-08-2002, 06:31 PM   #1
nimrod
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 &
exit

su user2
vncserver &
exit

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
executed.

Thanks for your help !
 
Old 12-08-2002, 11:37 PM   #2
jetfreggel
Member
 
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
SlickWilly
Member
 
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 :

:number
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:http://www.uk.research.att.com/vnc/sshvnc.html>.

# VNCSERVERS="1:myusername"

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

VNCSERVERS="1:fred"
VNCSERVERS="2:barney"

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.

Slick.
 
  


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 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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:58 PM.

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
Open Source Consulting | Domain Registration