Re: [SLUG] Init script to start VNC server as user (Debian)

2004-10-13 Thread amos
Simon Wong wrote:
Okay, so know I'm trying to start a VNC server with an init script as a
given user (on Debian).
As root I have tried running:
[EMAIL PROTECTED] : ~
# start-stop-daemon --start --chuid simon --user simon --exec \
/usr/bin/vncserver --chdir /home/simon/  -- -geometry=800x600

vncserver: Could not create /root/.vnc.

It appears that this is not actually changing to my user BEFORE starting
the process as the man page states.
It seems to be trying to write to root's home dir.
Actually it appears that it DOES chuid to your user but doesn't update
the $HOME envariable and therefore tries to write to ~root/.vnc as the
user. Maybe try to prefix this command with env HOME=/home/simon
start-stop-daemon  Another option to set this might be hiden in
/etc/vnc.conf, maybe something to do with $vncUserDir.

I couldn't find a bug on this so I'm assuming I'm not doing it right.
Anyone know how to make this work, or do I need to make a script that
uses su?
This seems to work but it's not l337:

[EMAIL PROTECTED] : ~
# su simon -c 'vncserver -geometry 800x600'

New 'voyager:1 (simon)' desktop is voyager:1

Starting applications specified in /home/simon/.vnc/xstartup
Log file is /home/simon/.vnc/voyager:1.log

What does su simon -c 'echo $HOME' give? On my debian with tcsh it
gives /home/amos (i.e. the user's home dir), which would agree with my
explenation above.
Cheers,
--Amos
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] Init script to start VNC server as user (Debian)

2004-10-12 Thread Simon Wong
Okay, so know I'm trying to start a VNC server with an init script as a
given user (on Debian).

As root I have tried running:

[EMAIL PROTECTED] : ~
# start-stop-daemon --start --chuid simon --user simon --exec \
/usr/bin/vncserver --chdir /home/simon/  -- -geometry=800x600

vncserver: Could not create /root/.vnc.

It appears that this is not actually changing to my user BEFORE starting
the process as the man page states.

It seems to be trying to write to root's home dir.

I couldn't find a bug on this so I'm assuming I'm not doing it right.

Anyone know how to make this work, or do I need to make a script that
uses su?

This seems to work but it's not l337:

[EMAIL PROTECTED] : ~
# su simon -c 'vncserver -geometry 800x600'

New 'voyager:1 (simon)' desktop is voyager:1

Starting applications specified in /home/simon/.vnc/xstartup
Log file is /home/simon/.vnc/voyager:1.log

-- 
Simon Wong [EMAIL PROTECTED]
Wongy.org

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html