[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: VNC local/remote



I generally just use a shell script to start a vnc session.  As more than
one person uses vnc on many of my systems each with differing display
setting.  It seems to have to do with age.  The older users tend to use
lower resolutions, go figure.  I have found this to be a better option than
changing vncserver defaults.

[paulhamm hephaistos paulhamm]$ more sv
#!/bin/sh
vncserver -geometry 1280x1024 -depth 24

-----Original Message-----
From: Cowles, Steve [mailto:Steve SteveCowles com]
Sent: Thu, December 12, 2002 10:50 AM
To: 'psyche-list redhat com'
Subject: RE: VNC local/remote


> -----Original Message-----
> From: Craig White
> Sent: Wednesday, December 11, 2002 9:10 PM
> Subject: Re: VNC local/remote
> 
> -----
> I note the addition of $ARGS - this time without 
> braces...didn't matter - still won't work - it returns an error...
> 
> # service vncserver start
> Starting VNC server: 1:craig -c: missing argument
> /etc/init.d/vncserver: line 31: su craig -c "cd ~craig && [ -f
> .vnc/passwd ] && vncserver :1 -geometry 1024x768  ": No such file or
> directory

I know... but the above should have worked. 

FWIW: This is what I use to add arguments for starting vncserver...

1) Added the following line to /etc/sysconfig/vncserver. This variable
assignment could be placed in the init script itself.

VNC_ARGS="-geometry 1024x768 -depth 16"

2) In /etc/init.d/vncserver, I added the $VNC_ARGS to the su call. Looks
identical to what you posted.

start() {
    echo -n $"Starting $prog: "
    ulimit -S -c 0 >/dev/null 2>&1
    RETVAL=0
    for display in ${VNCSERVERS}
    do
        echo -n "${display} "
        unset BASH_ENV ENV
        initlog $INITLOG_ARGS -c \
            "su ${display##*:} -c \"cd ~${display##*:} && [ -f .vnc/passwd ]
&& vncserver :${display%%:*} ${VNC_ARGS}\""
        RETVAL=$?
        [ "$RETVAL" -ne 0 ] && break
    done
    [ "$RETVAL" -eq 0 ] && success $"vncserver startup" || \
        failure $"vncserver start"
    echo
    [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vncserver
}

3) Now start vnc...

[root voyager init.d]# ./vncserver start
Starting VNC server: 1:scowles                    [  OK  ]
[root voyager init.d]#


4) To verify... check the process stack... Note the inclusion of the
-geometry and -depth arguments.

[root voyager init.d]# ps auwwx | grep Xvnc
scowles  20494  0.1  1.5  4660 2924 pts/1    S    09:32   0:00 Xvnc :1
-desktop X -httpd /usr/share/vnc/classes -auth /home/scowles/.xauthbQM1zD
-geometry 1024x768 -depth 16 -rfbwait 120000 -rfbauth
/home/scowles/.vnc/passwd -rfbport 5901 -fp unix/:7100

see below

> 
> And to answer your first question...yours has been the only 
> response so far...
> 
> ;-(
> 
> I have beaten this thing to death and I really want to 
> understand why I can't make it work. If I eliminate the $ARGS
> variable completely...I still can't put the arguments into
> that line without causing the error...
> for example...
> 
> "su ${display##*:} -c \"cd ~${display##*:} && [ -f .vnc/passwd ] && \
> vncserver :${display%%:*} -geometry 1024x768\""

You've got other problems if the above did not work . Possibly path related.

A good debugging tool I use is to set -x on your init script and watch what
happens. i.e. Change the first line of /etc/init.d/vncserver from:

#!/bin/bash

to:

#!/bin/bash -x


Now start vncserver manually by typing:

# cd /etc/init.d
# ./vncserver start

reams of output should point you in the right direction.

Good Luck!
Steve Cowles



-- 
Psyche-list mailing list
Psyche-list redhat com
https://listman.redhat.com/mailman/listinfo/psyche-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]