Active Topics

 


Reply
Thread Tools
Posts: 15 | Thanked: 1 time | Joined on Oct 2007
#1
Following the steps here: http://maemo.org/community/wiki/howtoaccesswindowscifs/ I have been able to get CIFS working. What I want to do next is use an init script to automatically mount and umount the share on boot/shutdown.

This is what I have made in /etc/init.d/

Code:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

case "$1" in
  start)
	insmod /mnt/initfs/lib/modules/cifs.ko
	mount -t cifs //192.168.1.x/Hdd /home/user/MyDocs/.documents/nslu2 -o domain=Workgroup,user=user,password=password
	;;
  stop)
	umount /home/user/MyDocs/.documents/nslu2
	;;
  *)
	echo "error"
	;;
esac
I can type ./cifs start and ./cifs stop and everything works like a charm. But when I boot up, nothing has happened.

By the way, I am trying to connect to a file share on my linksys NSLU2 - another really nifty linux device.

What am I doing wrong? I know the path is often a thorn in the side of linux scripts, but I think I've declared just about everything!
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#2
Perhaps the network is not connected at the boot time yet?
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 
Posts: 15 | Thanked: 1 time | Joined on Oct 2007
#3
Originally Posted by fanoush View Post
Perhaps the network is not connected at the boot time yet?
Hmm actually that is a distinct possibility. The GUI only displays "connected to Blah" well after everything else has booted up. Thanks for pointing out a very obvious point I missed.

In that case it's not an obstacle that can be easily surmounted.

Unless there is a way to run the script after the network is up? On some linux distributions you can number init scripts like S10, S20, S30 etc. That doesn't seem to be the case for the N800.

By the way, do you know how to set permissions so that the mounted folder is browsable in the File Manager by a non-root user?

My /nslu2 was created as a regular user. But once I mount it as root (I need to be root to use mount), the owner and group becomes 501/501. Is it safe to try chown and chgroup to put it back to user/users?
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#4
Originally Posted by Airw0lf View Post
Unless there is a way to run the script after the network is up?
yes, search this forum for some dbus related hackery. it was used for setting up bluetooth PAN. There is no ifup script automatically called by system when some interface comes up.

Originally Posted by Airw0lf View Post
My /nslu2 was created as a regular user. But once I mount it as root (I need to be root to use mount), the owner and group becomes 501/501. Is it safe to try chown and chgroup to put it back to user/users?
This is CIFS or NFS mount? I heard this is feature of NFS and is hard to workaround. As for CIFS I don't know about such problem, maybe you can turn off something related to users in samba on NSLU side?
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 
Posts: 15 | Thanked: 1 time | Joined on Oct 2007
#5
Originally Posted by fanoush View Post
This is CIFS or NFS mount? I heard this is feature of NFS and is hard to workaround. As for CIFS I don't know about such problem, maybe you can turn off something related to users in samba on NSLU side?
CIFS. I'm using mount -t cifs, and it seems to work, so I presume it's CIFS...
 
Reply


 
Forum Jump


All times are GMT. The time now is 07:49.