On Thu, 25 Apr 2002 21:43:41 -0500
"Jim Hale" <[EMAIL PROTECTED]> quietly intimated:

> Got VNC installed, running and everything is hunky dory. I just want
> to know if there's a way to start vncserver whenever I login using my
> root account and turn it off when I log out. I don't want it started
> when I reboot the machine, just when I login as root. I pretty leave
> it logged into this account since the machine is my Email/Webserver
> and just lock the screen (so the pitter-patter of kitty feet doesn't
> mess anything up.)

First, this isn't a good idea unless your machine is 100% isolated from
any outside connection (not even connected to another machine that is
connected to the outside, no matter how well isolated it is through the
other).

That said, you can run it at login via ~/.bashrc. To kill it, create (if
you don't already have one) a ~/.bash_logout with the kill command:

       vncserver -kill :<DISPLAY#>

That command BTW is direct from the manpage.

> It's setup here at my house so the only people that can get into it is
> my wife or cats (and neither are inclined to do so). 
> 
> Also - I started on computers back when DOS was all the rage (ok - I'm
> showing my age here) - anyway - I got pretty adept at writing batch
> files. Is there anything similar to that in Linux, and where/how would
> I add something that I DID want to run at startup or by creating an
> icon on the desktop?

Not exactly DO$, but bash scripting is close enough that it's easy to
learn and adapt. It's much more powerful and flexible. Tutorials are all
over the place, and even on your machine ('man bash' without quotes can
get you started).

Adding it to run automatically varies, as does creating an icon. The
latter depends on what desktop you use. The former depends on if you
want it system wide or individual.

For the first part, you can put it anywhere you like. If that isn't in
the path, it can be called by giving the full path. To make it system
wide, the customary places are in /etc/rc.d/rc.local (can also be
/etc/rc.local on newer releases). If you want it for the individual,
~/.bashrc is generally where you can put it.

When I say "put it in" one or the other, I mean put the call to the
script in them, not the actual script. In both instances, the entry
would look like this, assuming a script called STARTSCRIPT that was
located in /usr/local/sbin:

/usr/local/sbin/STARTSCRIPT &

The '&' on the end means the rest of thins can continue on without
waiting for the script to finish. If you want it to wait until the
script completes, leave the '&' off of the end.

If you want to suppress any output from the script so you don't see it
on the screen:

/usr/local/sbin/STARTSCRIPT > /dev/null 2>&1

The script itself I usually put in appropriate places. I created a
directory and placed it centrally for everybody and/or system use:
/usr/addon. I put it in everybody's path and individual binaries that I
get (i.e. not from a compiled program done by me and not from an rpm)
plus many scripts used by all can be placed there. For individual users
I put the in $HOME/bin for the user running it, and I put that directory
in everybody's path (I think it's on by default, though I might be
wrong). So if kcsmart is the only one that ever runs it, it's in
/home/kcsmart/bin and when kcsmart is logged in, $HOME/bin equates to
/home/kcsmart/bin, as does ~/bin. That makes any file there only in
kcsmart's path and nobody else (except root) can run it from there. The
variable $HOME changes for each user. So does the tilde (~) reference,
though there's an exception for that, too.

That's already much more than I wanted to get into. First start dealing
with the writing. Then you can concern yourself with the when, where and
how of getting it to run at certain times.

As for the icon deal, basically you write the script then create the
icon to run it, pointing it to the script. How is determined by the
desktop. I use icewm, and it doesn't have desktop icons by default
unless I use gnome. So there is no such thing. But there are still ways
to run it from an icon that's visible without using gnome. Gnome and kde
allow you to create icons right on the desktop (gnome through whatever
windowmanager you use, kde directly). So, this method varies and can't
be given a stock answer.

> OK - enough to chew on for now. :)

-- 
I'm so hungry, I could almost eat health food.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to