e837 [Solved] vncserver: Wrong type of access mode of .vnc - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Development > Userland Programming & Scripting

Userland Programming & Scripting C, Shell, Perl, Sed & Awk

Reply
 
Thread Tools Display Modes
  #1  
Old August 2nd, 2011, 21:30
hannibal80 hannibal80 is offline
Junior Member
 
Join Date: Aug 2011
Location: Rome - Italy
Posts: 42
Thanks: 5
Thanked 0 Times in 0 Posts
Default 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.

Last edited by DutchDaemon; August 2nd, 2011 at 21:41.
Reply With Quote
  #2  
Old August 3rd, 2011, 07:28
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

Quote:
Originally Posted by hannibal80 View Post
Code:
USER=Lorenzo
HOME=/usr/home/Lorenzo

export USER HOME
It doesn't work that way. Use su(1).
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
The Following User Says Thank You to SirDice For This Useful Post:
hannibal80 (August 4th, 2011)
  #3  
Old August 3rd, 2011, 08:38
hannibal80 hannibal80 is offline
Junior Member
 
Join Date: Aug 2011
Location: Rome - Italy
Posts: 42
Thanks: 5
Thanked 0 Times in 0 Posts
Default

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

#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="su /usr/local/bin/vncserver"

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

pidfile="${tightvnc_pidfile}"

run_rc_command "$1"
Thank you.
Reply With Quote
  #4  
Old August 3rd, 2011, 09:34
pbd pbd is offline
Member
 
Join Date: Nov 2008
Location: Brno, CZ
Posts: 187
Thanks: 9
Thanked 31 Times in 31 Posts
Default

Code:
command="su - Lorenzo -c /usr/local/bin/vncserver"
See su.
Reply With Quote
The Following User Says Thank You to pbd For This Useful Post:
hannibal80 (August 4th, 2011)
  #5  
Old August 3rd, 2011, 11:11
hannibal80 hannibal80 is offline
Junior Member
 
Join Date: Aug 2011
Location: Rome - Italy
Posts: 42
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Ok, tonight I'll try with that and I'll give you a feedback,
thank you!
Reply With Quote
  #6  
Old August 3rd, 2011, 17:28
hannibal80 hannibal80 is offline
Junior Member
 
Join Date: Aug 2011
Location: Rome - Italy
Posts: 42
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Yes, finally it works! Thank you!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
headless vnc particleman Web & Network Services 6 April 13th, 2010 11:03
Installed vnc but there's only vncviewer and no vncserver aurora72 Installation and Maintenance of FreeBSD Ports or Packages 4 October 4th, 2009 23:38
[Solved] vncserver, change the port gripek Web & Network Services 2 August 11th, 2009 13:28
start vncserver at boot? cipher Installation and Maintenance of FreeBSD Ports or Packages 4 June 4th, 2009 20:42
vnc and keyboard problems cipher Installation and Maintenance of FreeBSD Ports or Packages 3 May 13th, 2009 11:25


All times are GMT +1. The time now is 06:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0