[plug] VNC Shell Script

James Devenish devenish at guild.uwa.edu.au
Sun Nov 7 16:14:19 WST 2004


Hi,

Regarding the problem with the password popup:

 - I assume from its name that rfbdrake is Mandrake's own RFB server. As
   such, the best starting point may be Mandrake's documentation and
   manuals pages (e.g. `man rfbdrake` or Mandrake's own help system).
 - If rfbdrake is similar to other software that requires passwords,
   then it should have a non-GUI method of entering a password. In
   general, methods include: specifying the name of a file that contains
   the password, or entering a password from the keyboard, or piping the
   password to 'standard input', or passing a password as a command-
   line argument (eek). UNIX VNC servers generally accept an -rfbauth
   command-line option with which you specify the location of a file
   that you pre-created using the `vncpasswd` programme.
 - I find it odd to imagine that your cron job might be opening up a GUI
   box, because cron should not be invoking your script with a $DISPLAY
   variable.

In message <B0A9B2E8-3092-11D9-8F16-000D936A747A at iinet.net.au>
on Sun, Nov 07, 2004 at 03:57:37PM +0800, Brock Woolf wrote:
> Cron tab file, so far (without the dashes):
> */15 * * * * brock /brock_scripts/rfbdrake.sh

That looks a little unusual. I don't know what you mean by "dashes", but
maybe it needs to look like this:

> */15 * * * * ~brock/brock_scripts/rfbdrake.sh

> And this is the "rfbdrake.sh" shell script it refers to:
> #!/bin/sh
> if ps -auxww | grep "x0rfbserver" | grep -v grep ; then
> 	exit 0
> else
> 	rfbdrake

At the very least, that shell script will require the following line
after the 'rfbdrake' line:

fi

(Yes, 'fi' on its own, to balance the 'if'.)

Also, try to avoid parsing the output of `ps`. Consider replacing
"ps -auxww | grep "x0rfbserver" | grep -v grep" with
"pgrep x0rfbserver >/dev/null" or something with `pidof`.





More information about the plug mailing list