LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-03-2005, 01:39 PM   #1
Ruler2112
Member
 
Registered: Oct 2004
Location: Michigan, US
Distribution: Redhat 7.3, 9.0; Slackware 10, 10.1, 10.2, 11; FreeBSD 7.0; KnoppMyth 5.5
Posts: 125

Rep: Reputation: 16
Question Starting VNC from Startup


I have a Slackware 10.1 system that I've got set up as a video surveillance system. I've got TightVNC installed on it and have the server set to start at boot. However, I'm having a problem keeping it running when started from the init script.

I have the following in /etc/rc.d/rc.local to start up VNC. This works, as I've added debugging commands to dump the status of what's happening and the output of 'ps -ef |grep vnc' to a file between the commands listed and it shows as being started. However when I try to connect, I cannoy. When I log in and check, there's no vnc process running.

Code:
# Clear out orphaned X11 session locks
rm -f /tmp/.X11-unix/*

# Start VNC
su - root -c 'source /etc/profile;/usr/local/bin/vncserver :4'

I changed my /root/.vnc/xstartup as follows to start KDE instead of the default window manager. I've tried adding a sleep 10 before the exec command to make certain that the system has enough time to initialize whatever it needs to before the script commences, but it didn't affect the behavior of the situation.

Code:
#!/bin/sh
exec /etc/X11/xinit/xinitrc

The strange part is that running /etc/rc.d/rc.local when logged in as root starts up the VNC server and it runs perfectly - KDE is displayed when the remote computer connects and all is well. When the same commands are run via the bootup procedure, VNC stays alive for a short time (a matter of seconds I'm thinking) and then dies. I'm at a loss to explain why and am hoping somebody here can provide some insight into the problem. I was under the impression that running a command from the init scripts was the same as running the same command when logged in as root?

I've posted my VNC log below. The errors displayed only appear when the VNC process is started from the boot script and not from a command line.

Code:
01/05/05 13:59:14 Xvnc version 3.3.tight1.2.9
01/05/05 13:59:14 Copyright (C) 1999 AT&T Laboratories Cambridge.
01/05/05 13:59:14 Copyright (C) 2000-2002 Constantin Kaplinsky.
01/05/05 13:59:14 All Rights Reserved.
01/05/05 13:59:14 See http://www.uk.research.att.com/vnc for information on VNC
01/05/05 13:59:14 See http://www.tightvnc.com for TightVNC-specific information
01/05/05 13:59:14 Desktop name 'X' (VSS-Used1:4)
01/05/05 13:59:14 Protocol version supported 3.3
01/05/05 13:59:14 Listening for VNC connections on TCP port 5904
01/05/05 13:59:14 Listening for HTTP connections on TCP port 5804
01/05/05 13:59:14   URL http://VSS-Used1:5804
_FontTransSocketUNIXConnect: Can't connect: errno = 2
failed to set default font path 'unix/:7100'
Fatal server error:
could not open default font 'fixed'
01/05/05 13:59:14 Xvnc version 3.3.tight1.2.9
01/05/05 13:59:14 Copyright (C) 1999 AT&T Laboratories Cambridge.
01/05/05 13:59:14 Copyright (C) 2000-2002 Constantin Kaplinsky.
01/05/05 13:59:14 All Rights Reserved.
01/05/05 13:59:14 See http://www.uk.research.att.com/vnc for information on VNC
01/05/05 13:59:14 See http://www.tightvnc.com for TightVNC-specific information
01/05/05 13:59:14 Desktop name 'X' (VSS-Used1:4)
01/05/05 13:59:14 Protocol version supported 3.3
01/05/05 13:59:14 Listening for VNC connections on TCP port 5904
01/05/05 13:59:14 Listening for HTTP connections on TCP port 5804
01/05/05 13:59:14   URL http://VSS-Used1:5804
Font directory '/usr/X11R6/lib/X11/fonts/Speedo/' not found - ignoring
startkde: Starting up...
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
kbuildsycoca running...
Server has no DPMS extension
Xlib:  extension "XFree86-Misc" missing on display ":4.0".
server does not have extension for "r rate" option
Launched ok, pid = 2169
There are already artsd objects registered, looking if they are active...

Error: Can't add object reference (probably artsd is already running).
       If you are sure it is not already running, remove the relevant files:

       /tmp/mcop-root/Arts_SoundServerV2
       /tmp/mcop-root/Arts_SoundServer
       /tmp/mcop-root/Arts_SimpleSoundServer
       /tmp/mcop-root/Arts_PlayObjectFactory
       /tmp/mcop-root/Arts_AudioManager

QFont::setPointSize: Point size <= 0 (-3)
kdecore (KAction): WARNING: KAction::insertKAccel( kaccel = 0x80f1820 ): KAccel object already contains an action name "del"
X Error: BadValue (integer parameter out of range for operation) 2
  Major opcode:  102
  Minor opcode:  0
  Resource id:  0x0
X Error: BadValue (integer parameter out of range for operation) 2
  Major opcode:  102
  Minor opcode:  0
  Resource id:  0x0
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
klauncher: Exiting on signal 15
kded: Fatal IO error: client killed
KWrited - Listening on Device /dev/pts/1
kdeinit: Fatal IO error: client killed
kdeinit: sending SIGHUP to children.
*** kdesktop got signal 15 (Exiting)
*** kdesktop got signal 1 (Exiting)
kicker: sighandler called
kicker: sighandler called
kicker: Fatal IO error: client killed
warning: leaving MCOP Dispatcher and still kdesktop: Fatal IO error: client killed
15 object references alive.
  - Arts::SampleStorage
  - Arts::Synth_MULTI_ADD
  - Arts::Synth_MULTI_ADD
  - Arts::Synth_PLAY
  - Arts::StereoVolumeControl
  - Arts::StereoEffectStack
  - Arts::Synth_BUS_DOWNLINK
  - Arts::SoundServerV2
  - Arts::Synth_BUS_UPLINK
  - Arts::AudioManagerClient
  - Arts::Synth_AMAN_PLAY
  - Arts::Synth_BUS_UPLINK
  - Arts::Synth_AMAN_PLAY
  - Arts::AudioManagerClient
  - Arts::MidiManager
warning: leaving MCOP Dispatcher and still 188 types alive.
kdeinit: Fatal IO error: client killed
kdeinit: sending SIGHUP to children.
kdeinit: sending SIGTERM to children.
kdeinit: Exit.
kdeinit: sending SIGTERM to children.
kdeinit: Exit.
 
Old 05-03-2005, 01:46 PM   #2
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
Well if local starts the VNC then try to locate where in that script the vnc starts and make the script you want resemble that script. It should work.
 
Old 05-03-2005, 01:52 PM   #3
Ruler2112
Member
 
Registered: Oct 2004
Location: Michigan, US
Distribution: Redhat 7.3, 9.0; Slackware 10, 10.1, 10.2, 11; FreeBSD 7.0; KnoppMyth 5.5
Posts: 125

Original Poster
Rep: Reputation: 16
Quote:
Originally posted by marghorp
Well if local starts the VNC then try to locate where in that script the vnc starts and make the script you want resemble that script. It should work.
I don't understand your suggestion marghorp. I have the startup commands in /etc/rc.d/rc.local as shown in the first code block above. If I run it from the command line when logged in as root with /etc/rc.d/rc.local as the command, it starts and runs fine. When /etc/rc.d/rc.local is run when the system is booted, the errors shown in the last code block above are spit out to /root/.vnc/VSS-Used1:4.log and VNC does not stay running.

I have tried creating a /etc/rc.d/rc.vnc and adding the commands to start VNC in there, then calling that script from /etc/rc.d/rc.M the same as the other startup scripts, but to no avail - the same behavior presents itself. When I run /etc/rc.d/rc.vnc from a command line when logged in, everything is fine, but when fired from /etc/rc.d/rc.M, VNC dies.
 
Old 05-03-2005, 02:11 PM   #4
tangle
Senior Member
 
Registered: Apr 2002
Location: Arbovale, WV
Distribution: Slackware
Posts: 1,761

Rep: Reputation: 78
This is a guess on my part.

I think that you need the VNC server to start after X starts (/etc/rc.d/rc.local runs before X starts). It needs to pass the X session to a client, but if X is not started it can not do that. You might try to put the command at the end of the script that starts X.
 
Old 05-03-2005, 02:27 PM   #5
Ruler2112
Member
 
Registered: Oct 2004
Location: Michigan, US
Distribution: Redhat 7.3, 9.0; Slackware 10, 10.1, 10.2, 11; FreeBSD 7.0; KnoppMyth 5.5
Posts: 125

Original Poster
Rep: Reputation: 16
That's a good thought tangle. However, I don't have X starting with the machine - it boots to a text login prompt. Based on this though, I changed the command to start VNC in /etc/rc.d/rc.local to 'at now + 2 minutes < /etc/rc.d/rc.vnc' - give the machine plenty of time to get everything started before starting vnc. Same thing happened as before though.

It's almost like there's an environment variable or something that needs to be set in order to start X that's not set when it's fired from the boot script. I don't know what it would be though, especially since I'm su-ing when starting VNC in the startup script.
 
Old 05-03-2005, 02:58 PM   #6
tangle
Senior Member
 
Registered: Apr 2002
Location: Arbovale, WV
Distribution: Slackware
Posts: 1,761

Rep: Reputation: 78
Maybe you can set the path and such like when you log in. Such as:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games"

I'll read up on it later on tonight, maybe I might find something.
 
Old 05-03-2005, 03:40 PM   #7
Ruler2112
Member
 
Registered: Oct 2004
Location: Michigan, US
Distribution: Redhat 7.3, 9.0; Slackware 10, 10.1, 10.2, 11; FreeBSD 7.0; KnoppMyth 5.5
Posts: 125

Original Poster
Rep: Reputation: 16
That's what I thought I was doing with the 'source /etc/profile' part of the su line. I appreciate any help you can provide - I've spent several hours on this and am no closer to a solution than I was when I started.

The thing that gets me is that it works from a command line. (Makes troubleshooting fun, having to bounce the machine to test the smallest change.)
 
  


Reply



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 up vnc in mandrake nanjil Linux - Newbie 1 07-10-2005 09:32 AM
starting x in vnc maybbach Linux - Software 1 04-25-2005 08:56 PM
Help starting VNC service hongman Linux - Software 2 02-21-2005 03:58 PM
Starting X and a little VNC th3_d0c Linux - Software 1 08-18-2004 11:50 PM
starting KDE with VNC nadine.mauch Linux - Software 1 08-29-2003 01:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:59 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
Open Source Consulting | Domain Registration