RE: [newbie] start up script for mandrake

2004-08-25 Thread Bill Shirley


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of lmcilwain
 Sent: Tuesday, August 24, 2004 9:19 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [newbie] start up script for mandrake
 
 
 Now for for the exit is that a separate script?
 
 If I want to do a /etc/init.d /vncserver start is that just
 
  #!/bin/bash
  /usr/bin/X11/vncserver -user -depth 16 -geometry 1280x1024 :1 
 
 and for
 
 /etc/init.d/vncserver stop is that just
 
  To exit,
 
  killall Xvnc
 
 and both of these are just executable scripts that I place in the 
 /etc/init.d directory?
 
 I just want to be clear so I do this right the first time.
 
 
 On Aug 24, 2004, at 7:21 AM, Bryan Phinney wrote:
 
  On Monday 23 August 2004 09:44 pm, lmcilwain wrote:
  I can't seem to find any rpms so I am stuck with what I have which I
  know are the latest version.  I looked at the rpms that I have on my 
  cd
  but I didn't see a vnc server on it.  Which is why I believe that I
  downloaded thee source before.
 
  Actually, it is called:
  tightvnc-1.2.9-2mdk.i586.rpm  tightvnc-doc-1.2.9-2mdk.i586.rpm
  tightvnc-server-1.2.9-2mdk.i586.rpm
 
  If you are looking for vnc, you are not going to find it.  You need to 
  be
  looking for Tightvnc.
 
  I didn't see an rc.d file in my init.d directory in etc so I am
  wondering is there another place that I can install the startup script
  that you guys wrote?
 
  Sorry, that must have been a brain spasm on my part.  The correct 
  directory
  is /etc/rc.d/init.d  you can also get there by cd'ing to /etc/init.d 
  which is
  a symbolic link to /etc/rc.d/init.d
 
  Is there a way to simply write a script that
  points to the executable?
 
  I suppose, although it is not as elegant or functional as the script.
 
  #!/bin/bash
  /usr/bin/X11/vncserver -user -depth 16 -geometry 1280x1024 :1 
 
  To exit,
 
  killall Xvnc
  -- 
  Bryan Phinney
 
 
  
  Want to buy your Pack or Services from MandrakeSoft?
  Go to http://www.mandrakestore.com
  Join the Club : http://www.mandrakeclub.com
  
 
 
 

If you wanted to do it right you would install
tightvnc-server-1.2.9-2mdk.i586.rpm from the 3rd
CD on ML Official 10.0.

Run as root:
urpmi tightvnc-server

Bill



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] start up script for mandrake

2004-08-25 Thread Bryan Phinney
On Tuesday 24 August 2004 09:18 pm, lmcilwain wrote:
 Now for for the exit is that a separate script?

 If I want to do a /etc/init.d /vncserver start is that just

  #!/bin/bash
  /usr/bin/X11/vncserver -user -depth 16 -geometry 1280x1024 :1 

 and for

 /etc/init.d/vncserver stop is that just

  To exit,
 
  killall Xvnc

The #!/bin/sh or #!/bin/bash (either one works) goes in front of both commands 
and each is a separate script.  The first starts, the second stops.  These 
are not elegant, they don't remove lock files or even create lock files for 
that matter so running stuff like multiple vncsessions will not work without 
some tailoring.

 and both of these are just executable scripts that I place in the
 /etc/init.d directory?

No, the first script that I copied up to the newbie list is the one that goes 
into the /etc/init.d directory.  The two entries above can sit wherever you 
like them to sit and then you need to create pointers to them from 
the /etc/init.d directory and add in stuff like which run levels you want to 
start vncserver from.

The easiest way to create startup scripts from scratch is to use Webmin, go to 
System, Booting and Startup section and create a new process.  It will have 
windows for two commands, one to start and the second to stop.  Use the 
commands above and they should work.  it will also create the chkconfig 
settings and insure that the script will run at startup or not.

Just to make this as easy as I know how,  I am going to attach two files to 
this message.  The first file is vncserver, simply cp that into 
your /etc/init.d directory.  Next is vncservers, cp that to 
your /etc/sysconfig/vncservers directory.  Please open them, read them, look 
through them before copying them to your directory.  Assure yourself that I 
am not doing anything nefarious in these scripts (they come almost directly 
from the Mandrake RPM with the only change being the addition of startup 
options for vnc).  But look at them first, then copy them into the 
directories.

Next, edit the /etc/sysconfig/vncservers file and change username to your user 
name.  Save and exit the file.

Next, drop to CLI and su to root and issue these two commands:
chkconfig vncserver on
service vncserver start

Exit from root login and you should go back to your user prompt.  From there 
type:

vncviewer :1

And you should get your desktop up in a window.  Shouldn't take more than 2 
minutes tops and that is if you are a hunt and peck one finger typist.
-- 
Bryan Phinney


# 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.tightvnc.org.

# VNCSERVERS=1:myusername
VNCSERVERS=1:username
VNCARGS=-geometry 1280x1024 -depth 16 -alwaysshared 


vncserver
Description: application/shellscript

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] start up script for mandrake

2004-08-25 Thread Bryan Phinney
On Wednesday 25 August 2004 07:27 am, Bryan Phinney wrote:
 On Tuesday 24 August 2004 09:18 pm, lmcilwain wrote:
  Now for for the exit is that a separate script?
 
  If I want to do a /etc/init.d /vncserver start is that just
 
   #!/bin/bash
   /usr/bin/X11/vncserver -user -depth 16 -geometry 1280x1024 :1 
 
  and for
 
  /etc/init.d/vncserver stop is that just
 
   To exit,
  
   killall Xvnc

 The #!/bin/sh or #!/bin/bash (either one works) goes in front of both
 commands and each is a separate script.  The first starts, the second
 stops.  These are not elegant, they don't remove lock files or even create
 lock files for that matter so running stuff like multiple vncsessions will
 not work without some tailoring.

  and both of these are just executable scripts that I place in the
  /etc/init.d directory?

 No, the first script that I copied up to the newbie list is the one that
 goes into the /etc/init.d directory.  The two entries above can sit
 wherever you like them to sit and then you need to create pointers to them
 from the /etc/init.d directory and add in stuff like which run levels you
 want to start vncserver from.

 The easiest way to create startup scripts from scratch is to use Webmin, go
 to System, Booting and Startup section and create a new process.  It will
 have windows for two commands, one to start and the second to stop.  Use
 the commands above and they should work.  it will also create the chkconfig
 settings and insure that the script will run at startup or not.

 Just to make this as easy as I know how,  I am going to attach two files to
 this message.  The first file is vncserver, simply cp that into
 your /etc/init.d directory.  

 Next is vncservers, cp that to 
 your /etc/sysconfig/vncservers directory.  
Correction.  cp vncservers to your /etc/sysconfig directory.
Like: cp vncservers /etc/sysconfig/vncservers

 Please open them, read them, 
 look through them before copying them to your directory.  Assure yourself
 that I am not doing anything nefarious in these scripts (they come almost
 directly from the Mandrake RPM with the only change being the addition of
 startup options for vnc).  But look at them first, then copy them into the
 directories.

 Next, edit the /etc/sysconfig/vncservers file and change username to your
 user name.  Save and exit the file.

 Next, drop to CLI and su to root and issue these two commands:
 chkconfig vncserver on
 service vncserver start

 Exit from root login and you should go back to your user prompt.  From
 there type:

 vncviewer :1

 And you should get your desktop up in a window.  Shouldn't take more than 2
 minutes tops and that is if you are a hunt and peck one finger typist.

-- 
Bryan Phinney



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] start up script for mandrake

2004-08-24 Thread Bryan Phinney
On Monday 23 August 2004 09:44 pm, lmcilwain wrote:
 I can't seem to find any rpms so I am stuck with what I have which I
 know are the latest version.  I looked at the rpms that I have on my cd
 but I didn't see a vnc server on it.  Which is why I believe that I
 downloaded thee source before.

Actually, it is called:
tightvnc-1.2.9-2mdk.i586.rpm  tightvnc-doc-1.2.9-2mdk.i586.rpm  
tightvnc-server-1.2.9-2mdk.i586.rpm

If you are looking for vnc, you are not going to find it.  You need to be 
looking for Tightvnc.

 I didn't see an rc.d file in my init.d directory in etc so I am
 wondering is there another place that I can install the startup script
 that you guys wrote?  

Sorry, that must have been a brain spasm on my part.  The correct directory 
is /etc/rc.d/init.d  you can also get there by cd'ing to /etc/init.d which is 
a symbolic link to /etc/rc.d/init.d

 Is there a way to simply write a script that 
 points to the executable?  

I suppose, although it is not as elegant or functional as the script.

#!/bin/bash
/usr/bin/X11/vncserver -user -depth 16 -geometry 1280x1024 :1 

To exit, 

killall Xvnc
-- 
Bryan Phinney



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] start up script for mandrake

2004-08-24 Thread lmcilwain
Now for for the exit is that a separate script?
If I want to do a /etc/init.d /vncserver start is that just
#!/bin/bash
/usr/bin/X11/vncserver -user -depth 16 -geometry 1280x1024 :1 
and for
/etc/init.d/vncserver stop is that just
To exit,
killall Xvnc
and both of these are just executable scripts that I place in the 
/etc/init.d directory?

I just want to be clear so I do this right the first time.
On Aug 24, 2004, at 7:21 AM, Bryan Phinney wrote:
On Monday 23 August 2004 09:44 pm, lmcilwain wrote:
I can't seem to find any rpms so I am stuck with what I have which I
know are the latest version.  I looked at the rpms that I have on my 
cd
but I didn't see a vnc server on it.  Which is why I believe that I
downloaded thee source before.
Actually, it is called:
tightvnc-1.2.9-2mdk.i586.rpm  tightvnc-doc-1.2.9-2mdk.i586.rpm
tightvnc-server-1.2.9-2mdk.i586.rpm
If you are looking for vnc, you are not going to find it.  You need to 
be
looking for Tightvnc.
I didn't see an rc.d file in my init.d directory in etc so I am
wondering is there another place that I can install the startup script
that you guys wrote?
Sorry, that must have been a brain spasm on my part.  The correct 
directory
is /etc/rc.d/init.d  you can also get there by cd'ing to /etc/init.d 
which is
a symbolic link to /etc/rc.d/init.d

Is there a way to simply write a script that
points to the executable?
I suppose, although it is not as elegant or functional as the script.
#!/bin/bash
/usr/bin/X11/vncserver -user -depth 16 -geometry 1280x1024 :1 
To exit,
killall Xvnc
--
Bryan Phinney

Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] start up script for mandrake

2004-08-23 Thread Bryan Phinney
On Monday 23 August 2004 06:08 pm, lmcilwain wrote:
 Hello all,

 I am looking to create a startup script for vnc server.  I had to
 compile it from source cause it didn't come with the install that I
 have.  Can someone tell me how I can do this or where I need to make
 entries.

Use this in your /etc/init.d/rc.d directory

#!/bin/bash
#
# chkconfig: - 91 35
# description: Starts and stops vncserver. \
#  used to provide remote X administration services.

# Source function library.
. /etc/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = no ]  exit 0

VNCSERVERS=
[ -f /etc/sysconfig/vncservers ]  . /etc/sysconfig/vncservers

prog=$VNC server

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

stop() {
gprintf Shutting down %s:  $prog
for display in ${VNCSERVERS}
do
gprintf %s  ${display}
unset BASH_ENV ENV
initlog $INITLOG_ARGS -c \
su ${display##*:} -c \vncserver -kill :${display%%:*} /dev/null 
21\
done
RETVAL=$?
[ $RETVAL -eq 0 ]  success $vncserver shutdown || \
failure vncserver shutdown
echo
[ $RETVAL -eq 0 ]  rm -f /var/lock/subsys/vncserver
}

# See how we were called.
case $1 in
  start)
start
;;
  stop)
stop
;;
  restart|reload)
stop
start
;;
  condrestart)
if [ -f /var/lock/subsys/vncserver ]; then
stop
start
fi
;;
  status)
status Xvnc
;;
  *)
gprintf Usage: %s {start|stop|restart|condrestart|status}\n $0
exit 1
esac



-- 
Bryan Phinney



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



RE: [newbie] start up script for mandrake

2004-08-23 Thread Bill Shirley


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of lmcilwain
 Sent: Monday, August 23, 2004 6:08 PM
 To: [EMAIL PROTECTED]
 Subject: [newbie] start up script for mandrake
 
 
 Hello all,
 
 I am looking to create a startup script for vnc server.  I had to 
 compile it from source cause it didn't come with the install that I 
 have.  Can someone tell me how I can do this or where I need to make 
 entries.
 
 
 I have tried looking in the MCC under services but I didn't see a 
 service for vnc.
 
 Please let me know.
 
 Thanks,
 
 
 

Mandrake has it; it is called tightvnc:
[EMAIL PROTECTED] cd123and4]# rpm -qa | grep vnc
tightvnc-1.2.9-2mdk
tightvnc-server-1.2.9-2mdk

urpmi tightvnc-server

Change this in /etc/init.d/vncserver:
#
# chkconfig: 2345 91 35
# description: Starts and stops vncserver. \
#  used to provide remote X administration services.

USER=root
export USER

# Source function library.
. /etc/init.d/functions

Add your id's to /etc/sysconfig/vncservers.

Then 'chkconfig --add vncserver'

HTH,
Bill



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] start up script for mandrake

2004-08-23 Thread lmcilwain
I don't have an /rc.d directory.  I guess I will try to install the rpm 
if I can.  Will this have an adverse affect to the fact that I 
installed this from scratch?  Can I just delete the usr/local/vnc 
directory and then re install the rpm?

On Aug 23, 2004, at 6:18 PM, Bryan Phinney wrote:
On Monday 23 August 2004 06:08 pm, lmcilwain wrote:
Hello all,
I am looking to create a startup script for vnc server.  I had to
compile it from source cause it didn't come with the install that I
have.  Can someone tell me how I can do this or where I need to make
entries.
Use this in your /etc/init.d/rc.d directory
#!/bin/bash
#
# chkconfig: - 91 35
# description: Starts and stops vncserver. \
#  used to provide remote X administration services.
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = no ]  exit 0
VNCSERVERS=
[ -f /etc/sysconfig/vncservers ]  . /etc/sysconfig/vncservers
prog=$VNC server
start() {
gprintf Starting %s:  $prog
ulimit -S -c 0 /dev/null 21
RETVAL=0
for display in ${VNCSERVERS}
do
gprintf %s  ${display}
initlog $INITLOG_ARGS -c \
su ${display##*:} -c \cd ~${display##*:}  [ -f 
.vnc/passwd ]
 vncserver :${display%%:*}\
RETVAL=$?
[ $RETVAL -ne 0 ]  break
done
[ $RETVAL -eq 0 ]  success $vncserver startup || \
failure vncserver start
echo
[ $RETVAL -eq 0 ]  touch /var/lock/subsys/vncserver
}

stop() {
gprintf Shutting down %s:  $prog
for display in ${VNCSERVERS}
do
gprintf %s  ${display}
unset BASH_ENV ENV
initlog $INITLOG_ARGS -c \
su ${display##*:} -c \vncserver -kill :${display%%:*} /dev/null
21\
done
RETVAL=$?
[ $RETVAL -eq 0 ]  success $vncserver shutdown || \
failure vncserver shutdown
echo
[ $RETVAL -eq 0 ]  rm -f /var/lock/subsys/vncserver
}
# See how we were called.
case $1 in
  start)
start
;;
  stop)
stop
;;
  restart|reload)
stop
start
;;
  condrestart)
if [ -f /var/lock/subsys/vncserver ]; then
stop
start
fi
;;
  status)
status Xvnc
;;
  *)
gprintf Usage: %s {start|stop|restart|condrestart|status}\n $0
exit 1
esac

--
Bryan Phinney

Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] start up script for mandrake

2004-08-23 Thread lmcilwain
I can't seem to find any rpms so I am stuck with what I have which I 
know are the latest version.  I looked at the rpms that I have on my cd 
but I didn't see a vnc server on it.  Which is why I believe that I 
downloaded thee source before.

I didn't see an rc.d file in my init.d directory in etc so I am 
wondering is there another place that I can install the startup script 
that you guys wrote?  Is there a way to simply write a script that 
points to the executable?  I want to have a good idea of what I am 
debugging if something is wrong lol.

Thanks for the help.
On Aug 23, 2004, at 8:54 PM, Bryan Phinney wrote:
On Monday 23 August 2004 07:28 pm, lmcilwain wrote:
I don't have an /rc.d directory.  I guess I will try to install the 
rpm
if I can.  Will this have an adverse affect to the fact that I
installed this from scratch?  Can I just delete the usr/local/vnc
directory and then re install the rpm?
I am pretty sure that the RPM's for TightVNC are for the latest 
version, so it
should be fine to install those over whatever you have now.

--
Bryan Phinney

Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com