RE: VNC local/remote

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

 



Replying to my own post... I figured it out...something that I have
never seen before.

this would work...
        initlog $INITLOG_ARGS -c \
             "su ${display##*:} -c \"cd ~${display##*:} && [ -f
.vnc/passwd ] && vncserver :${display%%:*} $ARGS\""
#            "su ${display##*:} -c \"cd ~${display##*:} && [ -f
.vnc/passwd ] && vncserver :${display%%:*}\""

but this wouldn't...
        initlog $INITLOG_ARGS -c \
#             "su ${display##*:} -c \"cd ~${display##*:} && [ -f
.vnc/passwd ] && vncserver :${display%%:*} $ARGS\""
            "su ${display##*:} -c \"cd ~${display##*:} && [ -f
.vnc/passwd ] && vncserver :${display%%:*} $ARGS\""

Apparently you can't have comments within the continuation line of the
line before my problem...sheesh - all this time and energy because I
wanted to play it safe.

Craig

On Thu, 2002-12-12 at 09:53, Craig White wrote:
> Actually, I understand that and I can launch the vncserver as any
> individual user.
> 
> I have been trying to launch it via the /etc/init.d/vncserver script as
> a service which seems to launch as su and then reverts to the user(s)
> listed in /etc/sysconfig/vncservers and launches per the setup.
> 
> The problem comes when I try to append any extra arguments to the
> /etc/init.d/vncserver script either by putting the arguments into the
> line which launches vncserver or by putting the $ARGS variable lifted
> from /etc/sysconfig/vncservers...it always breaks and returns the error
> that I listed earlier in the thread.
> 
> I am trying to use this as a learning process since I obviously can
> launch as an individual user, directly or by script...but not by a
> modified /etc/init.d/vncserver script which was the basis of the article
> in linux journal which is where I started with this.
> 
> Thanks,
> Craig
> 
> On Thu, 2002-12-12 at 08:59, Paul Hamm wrote:
> > 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



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

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux