[AppleTV1] Problem mounting NFS at boot
#1
Hi everyone,

Sorry if this has been covered before, but I tried searching and couldn't find anything.

I've got a "patched" AppleTV (Gen 1) with NitoTV installed. I can mount NFS shares (hosted on my WD My Book Live World Edition) manually just fine by issuing the following:

Code:
sudo bash
/sbin/mount -t nfs -o rw NAS:/DataVolume/Public ~/NAS/Public
/sbin/mount -t nfs -o rw NAS:/DataVolume/home ~/NAS/home

I see the mounts, browse files, watch movies, etc.

When I put them into my /etc/rc.local file and reboot, the mounts don't come back. I'm confident that rc.local is being run because I put this in at the end of the file:

Code:
echo $(date) >> /users/frontrow/boot.log
echo User Name: >> /users/frontrow/boot.log
whoami  >> /users/frontrow/boot.log
sleep 45
/sbin/mount -t nfs -o rw NAS:/DataVolume/Public ~/NAS/Public  >> /users/frontrow/boot.log
/sbin/mount -t nfs -o rw NAS:/DataVolume/home ~/NAS/home  >> /users/frontrow/boot.log
echo "Boot Done" >> /users/frontrow/boot.log

And here's a "cat" of my boot.log:
Code:
Sun Sep 25 21:19:23 EDT 2011
User Name:
root
Boot Done

This is driving me crazy! Anyone know why the mount commands work from a command line, but not from rc.local?

Thanks!
John
Reply
#2
could be network is not up yet.

the correct method under drawin is to use a launchd plist
Reply
#3
pretty sure the network is up because i am able to ssh in to the box and tail -f the boot.log and see the "user name" and "root" lines several seconds before the "boot done" message is posted.

I just tried creating a launchd plist and it didn't work. Here's what I did:

1) sudo'd to bash
2) created a directory: /System/Library/StartupItems/MountShares
3) Created a file called MountShares
4) Created a file called StartupParameters.plist
5) Chmod'd both files to chmod 755

Here are the contents of the files:

MountShares
Quote:#!/bin/sh
. /etc/rc.common

# The start subroutine
StartService() {
# mount_nfs "mediaserver.local:/mediafiles" /Users/frontrow/Remote
/sbin/mount -t nfs -o rw NAS:/DataVolume/Public ~/NAS/Public
/sbin/mount -t nfs -o rw NAS:/DataVolume/home ~/NAS/home

}

# The stop subroutine
StopService() {
# umount /Users/frontrow/Remote
/sbin/umount ~/NAS/Public
/sbin/umount ~/NAS/home
}

# The restart subroutine
RestartService() {
# umount /Users/frontrow/Remote
# mount_nfs "mediaserver.local:/mediafiles" /Users/frontrow/Remote
/sbin/umount ~/NAS/Public
/sbin/umount ~/NAS/home
/sbin/mount -t nfs -o rw NAS:/DataVolume/Public ~/NAS/Public
/sbin/mount -t nfs -o rw NAS:/DataVolume/home ~/NAS/home

}

RunService "$1"

StartupParameters.plist
Quote:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>Description</key>
<string>Mount Shares</string>
<key>OrderPreference</key>
<string>Late</string>
<key>Provides</key>
<array>
<string>Network Shares</string>
</array>
<key>Uses</key>
<array>
<string>Network</string>
</array>
<key>Requires</key>
<array>
<string>Network</string>
</array>
</dict>
</plist>


Anyone have any ideas? I'm new to the linux/mac/whatever space and that's my first plist I've created, so I may have gotten it wrong....
Reply
#4
nothing in syslog ?
Reply
#5
Not sure where to find the syslog but some googling pointed me at the asl.db file.

Like I said, I'm new to the OSX, Linux, etc. scene so i have no way to read the file. Here is the link to the asl.db (http://www.lachut.com/asl.zip) file so if anyone can give me a hand, I would greatly appreciate it. I rebooted right before I captured the file...

John
Reply

Logout Mark Read Team Forum Stats Members Help
[AppleTV1] Problem mounting NFS at boot0