LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-16-2004, 08:17 PM   #16
flysideways
Member
 
Registered: Jul 2003
Posts: 151

Rep: Reputation: 30

I just finished my first headless server using FC1.

My rc.local is:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

/bin/su -l username -c "/usr/bin/vncserver :1"

/bin/su -l root -c "/usr/bin/vncserver :2"


It does start both a session for a user and root. I am using the win32 vncviewer client to log onto it. The two boxes are connected only to each other through a xover cable so I'm not too concerned about the root session.

When vncserver is run for any user it creates a directory in that user's /home.
/home/username/vnc/xstartup for my server is:

#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

Notice the two lines after

# Uncomment the following two lines for normal desktop:

I uncommented those to get a normal desktop instead of twm. Do that for each user that you set up.

Good Luck

Today I also got the magic packets working, so I don't even have go over and turn it on. It's done from the client. Woohoo.
 
Old 05-16-2004, 09:51 PM   #17
florian_mrt
Member
 
Registered: Mar 2004
Location: Bristol, UK
Distribution: Linux Red Hat 9
Posts: 37

Original Poster
Rep: Reputation: 16
Hello,

Yooohoooo! It works !

Not entirely like I firstly thought it was going to be, but Im more than happy like it is now!

Your rc.local did the job! My rc.local looks now like:

touch /var/lock/subsys/local
/bin/su -l root -c "/usr/local/bin/vncserver :1"
/usr/local/bin/noip2 &

So I only log in as root. That happily does the job!

I dont get a login screen like it was meant with xf4vnc, but thats fine to me. I have immediate and automatic access to my RedHat box, and hence I dont need my keyboard and mouse further.

Some additions I might consider now are security, and how to access it on the internet over a residential LAN, but the main thing is achieved!

Thanks to everybody that brought me forward here! If anyone passes Bristol (UK), mail me and a pint is granted!
 
Old 05-16-2004, 11:11 PM   #18
Grizzenbeorn
LQ Newbie
 
Registered: May 2004
Location: Sydney, Aus
Distribution: Slackware 9.1
Posts: 5

Rep: Reputation: 0
Yep, mine works as well. Had to go with:

/bin/su -l -c "usr/local/bin/vncserver :1" &

as it would not work if I left 'root' in as user. The only difference from my original script is the addition of the "-l". Didn't read anything about that in any of the dozens of postings I poured through on other sites. Keyboard and mouse are gone and I am a happy camper.

Thanks for the help!
 
Old 05-17-2004, 04:00 PM   #19
florian_mrt
Member
 
Registered: Mar 2004
Location: Bristol, UK
Distribution: Linux Red Hat 9
Posts: 37

Original Poster
Rep: Reputation: 16
Any alternative to IIS for Linux?

LinuxQuestions.org > Forums > Linux - Networking > Any alternative to IIS for Linux?


My next thread and problem

Its more like a discussion rather than a question ...
 
Old 05-24-2004, 03:02 PM   #20
draceteam
LQ Newbie
 
Registered: May 2004
Location: texas
Distribution: suse 9.1
Posts: 7

Rep: Reputation: 0
k I have suse 9.1 personal edition
I don't have a rc.local
the only .local
is boot.local in the /etc/rc.d
I have rc0.d-rc6.d directories
but there is nothing but s20halt in all of them


Am I just in the totally wrong place??
also my vnc starts up but only with terminal
i have edited xstartup with
start kde &
for the last line
 
Old 05-24-2004, 03:08 PM   #21
florian_mrt
Member
 
Registered: Mar 2004
Location: Bristol, UK
Distribution: Linux Red Hat 9
Posts: 37

Original Poster
Rep: Reputation: 16
Autch, don't have that distro. If you have find out a conf file that runs from the beginning, you might try out putting this into there:

/bin/su -l root -c "/usr/local/bin/vncserver :1"

That solved it for me. Good luck...
 
Old 05-24-2004, 05:23 PM   #22
kd7edh
LQ Newbie
 
Registered: May 2004
Posts: 9

Rep: Reputation: 0
Quote:
Originally posted by Grizzenbeorn
I have been having similar problems. I run Slackware 9.1 and have tried all of the suggestions above but end up with the same error message on boot: "vncserver: could not find "xauth" on your PATH." vnc works very well after I have logged in but for the same reasons above would love to have it run on boot.

Thanks in advance
I was getting that exact xauth error with this:

/usr/local/bin/vncserver :1

but then I switch to this, and I no longer get that error! Thanks!

/bin/su - user -c "/usr/local/bin/vncserver :1 &" &
 
Old 05-24-2004, 05:41 PM   #23
kd7edh
LQ Newbie
 
Registered: May 2004
Posts: 9

Rep: Reputation: 0
Quote:
Originally posted by draceteam
k I have suse 9.1 personal edition
I don't have a rc.local
the only .local
is boot.local in the /etc/rc.d
I have rc0.d-rc6.d directories
but there is nothing but s20halt in all of them


Am I just in the totally wrong place??
also my vnc starts up but only with terminal
i have edited xstartup with
start kde &
for the last line


I do have the 9.0 distro, which is probably setup exactly the same.

If you read /etc/init.d/README it explains that they decided to change the way the startup files work, in order to conform to something or other.

What you will want to do is to create a the file /etc/init.d/rc.local and add the script listed above. Make sure to give the script excute rights, etc. The script can be named what ever you want, and be located anywhere. The important thing is the next step which links to your script.

Then you need to create a link to that file and place it in the appropriate rc#.d directory. Example: ln -s /etc/init.d/rc.local /etc/init.d/rc5.d/S18custom

The capital 'S' indicates a startup file. If you want to make an appropriate shutdown file use capital 'K'. The '18' is the order in which the files are execute. A file of S17 was the highest I saw, so I then used 18. 'custom' is what ever you want to name the script.

For some reason my vncserver script was located at /usr/X11R6/bin/vncserver. So add that to your now created rc. For example, on my system I used:
su - bobcharm -c "/usr/X11R6/bin/vncserver :1 &" &

I did need to initally log in as "bobcharm" and run the vncpasswd though, otherwise it will request it on startup, but it will be moved to the background, and you may never know it.

Anyway, this is kind of long, but I have now spent two weeks trying to get this exact problem solved with the Suse distro.
 
Old 05-25-2004, 10:43 AM   #24
draceteam
LQ Newbie
 
Registered: May 2004
Location: texas
Distribution: suse 9.1
Posts: 7

Rep: Reputation: 0
Thanks

Thanks I will get all that worked up, at least after a reboot I have access to the box through ssh so any changes I make to the startup with vnc I can check remotely(makes life easier)
I will post what I come up with
 
Old 09-13-2005, 01:42 PM   #25
guergenferkulat
LQ Newbie
 
Registered: Sep 2005
Posts: 1

Rep: Reputation: 1
setting up PATH while su user

for me it worked after i modified the line by export the paths
like this

su -l user -c ' export PATH=$PATH:/usr/X11R6/bin:/usr/bin:/bin; \
export HOME=/home/user;/usr/bin/vncserver -geometry 800x600 -depth 16'

it seems i cant post such long textlines here
just put it in one line ( at least i did ) in /etc/rc.local

vncserver is a perlscript and checks where to find some programs:
Xvnc, uname, xauth, vncpasswd

please check where in ur system these files are and change it for ur needs

this perlscript checks also whether the $HOME variable is set properly
thats why u should also change "user" with the user u want to start the vncserver.

I hope it works for your distribution
i have Archlinux
 
1 members found this post helpful.
  


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
start vncserver. bruse Linux - Networking 1 09-10-2005 12:21 PM
Robust vncserver startup file (rc.vncserver) arobinson74 Slackware 4 05-14-2005 05:33 AM
how to start the vncserver ust Linux - Software 1 05-11-2005 02:23 AM
vncserver won't start from rc.local GD_19 Linux - Software 5 03-13-2004 12:27 AM
Slackware vncserver start/boot script luegner Slackware 1 03-12-2004 09:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:30 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