run Tightvncserver at startup
I'm helping our local Public Library setup a Proxy Server.
Their tech guy is somewhat familiar with Debian, so the box is running Debian 6.0a (squeeze) - I'm more familiar with RHEL/CentOS.
We got it running without the GUI (gnome) auto running (i.e. it starts up to a login prompt). Boy do I miss 'chkconfig' and 'service'.
SSH, Squid, and the Squid Log Analyzer is all running ok at that point.
apt-get install tightvncserver got the app installed without any problems.
At first, I couldn't get tightvncserver to run without logging in a user (padmin).
I setup a tightvnc init.d script, and from the terminal, after logging in, the script correctly starts tightvncserver running as the user (padmin).
Adding that script to the services menu, and checking it to run at startup doesn't work.
First it gave a "missing user environment" error.
I added USER=padmin, and export USER to the script above the statement tightvncserver :1.
That almost works. The server starts up, starts tightvncserver without any errors, and stops at the login prompt.
The only problem is the VNC session is 'root' not 'padmin'.
So, what am I doing wrong?
So close, but logging into a remote GUI session as 'root' has trouble written all over it.
Thanks for any pointers, examples, code, etc (wild laughter is pretty much assumed).