vncserver: Wrong type of access mode of .vnc

Hello everyone,
I'm really a newbie to FreeBSD.

I'm trying to make vncserver able to automatic start up on boot with a user that's not root.

So, I spent 3 nights reading everywhere about my issues and I was able to get vnc working with xfce4. The server I used is tightvnc.

Now, the last step for now is to make it start up on boot.

I made a script, tightvnc, and I put it into /usr/local/etc/rc.d

Code:
#!/bin/sh
#

# REQUIRE: DAEMON
# PROVIDE: tightvnc

. /etc/rc.subr

USER=Lorenzo
HOME=/usr/home/Lorenzo

export USER HOME

PATH=$PATH:/usr/local/bin/ && export PATH
echo $PATH
echo $USER
echo $HOME

name="tightvnc"
rcvar=`set_rcvar`
load_rc_config $name
command="/usr/local/bin/vncserver"

tightvnc_enable=${tightvnc_enable-"NO"}
tightvnc_pidfile=${tightvnc_pidfile-"/var/run/tightvnc.pid"}

pidfile="${tightvnc_pidfile}"

run_rc_command "$1"

then I modified my /etc/rc.conf adding
Code:
tightvnc_enable="YES"

Now, when I reboot I have:

Code:
[...]
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
Lorenzo
/usr/home/Lorenzo
Starting tightvnc.
vncserver: Wrong type or access mode of /usr/home/Lorenzo/.vnc.
/etc/rc: WARNING: failed to start tightvnc
[...]

I've checked the .vnc permission that are:

Code:
# pwd
/usr/home/Lorenzo
# ls -l | grep vnc
drwxrwxrwx  2 Lorenzo  wheel      512 Aug  2 21:36 .vnc

and

Code:
# pwd
/usr/home/Lorenzo/.vnc
# ls -l
total 4932
-rw-------  1 Lorenzo  wheel        8 Aug  2 00:04 passwd
-rw-------  1 Lorenzo  wheel  5025792 Aug  2 00:08 xfce4-settings-help.core
-rwxr-xr-x  1 Lorenzo  wheel      204 Aug  2 00:07 xstartup

this is the content of /usr/home/Lorenzo/.vnc/xstartup


Code:
#!/bin/sh

/usr/local/bin/startxfce4

#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &

Can you please help me?

Thanks in advice.
 
Hi Sir, thanks for your replay.

But, as I'm a real newbie, how can I use "su" directive in my script? How can I change it?

Something like this?

Code:
#!/bin/sh
#

# REQUIRE: DAEMON
# PROVIDE: tightvnc

. /etc/rc.subr
[color="Red"]
#USER=Lorenzo
#HOME=/usr/home/Lorenzo

#export USER HOME[/color]

PATH=$PATH:/usr/local/bin/ && export PATH
echo $PATH
[color="Red"]#echo $USER
#echo $HOME
[/color]
name="tightvnc"
rcvar=`set_rcvar`
load_rc_config $name
[color="Red"]command="su /usr/local/bin/vncserver"[/color]

tightvnc_enable=${tightvnc_enable-"NO"}
tightvnc_pidfile=${tightvnc_pidfile-"/var/run/tightvnc.pid"}

pidfile="${tightvnc_pidfile}"

run_rc_command "$1"

Thank you.
 
Back
Top