View previous topic :: View next topic |
Author |
Message |
nebsager n00b
Joined: 20 Dec 2003 Posts: 13 Location: Denmark
|
Posted: Mon Jun 02, 2008 6:22 pm Post subject: Tightvnc: different settings for each user [SOLVED] |
|
|
Hi
I'm using Tightvnc on my gentoo server with no problems. Iuse the /etc/init.d/vnc script on startup and has two vnc's set up in /etc/conf.d/vnc.
My problem is that I would like to have different geometry on each of the vnc servers... is it possible to set it up in /etc/conf.d/vnc or should I use another solution?
/Stine
Last edited by nebsager on Tue Jun 03, 2008 6:36 am; edited 1 time in total |
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Tue Jun 03, 2008 3:50 am Post subject: |
|
|
The script and config file don't support per-user server options, just a VNC_OPTS setting that applies to all users. It is not difficult to add the capability if you don't mind making a local edit to the init script.
First, modify /etc/init.d/vnc to support per-user options. In the start() function, replace this line: /etc/init.d/vnc before: | su ${user%%:*} -c "cd /home/${user%%:*} && vncserver :${user##*:} $VNC_OPTS" &>/dev/null | with this: /etc/init.d/vnc after: | user_opts=VNC_OPTS_${user%%:*}
su ${user%%:*} -c "cd /home/${user%%:*} && vncserver :${user##*:} $VNC_OPTS ${!user_opts}" &>/dev/null |
Then set VNC_OPTS_user variables in /etc/conf.d/vnc to define per-user options such as display geometry. Like so: /etc/conf.d/vnc (sample): | DISPLAYS="hilts:1 bartlett:2"
# Server options common to all users
VNC_OPTS="-depth 8"
# Per-user options
VNC_OPTS_hilts="-geometry 800x600"
VNC_OPTS_bartlett="-geometry 1600x1200" |
An update to TightVNC would overwrite this enhancement but it's trivial to reinstate. Plus, it's a config-protected directory so you'd be prompted to approve the change.
Note the above is based on a RealVNC installation, not TightVNC, but the init script is no doubt very similar if not identical. If not, post it and I'll try to help out. _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
nebsager n00b
Joined: 20 Dec 2003 Posts: 13 Location: Denmark
|
Posted: Tue Jun 03, 2008 6:36 am Post subject: |
|
|
Thanks timeBandit
It works perfect! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|