Tag Archives: chown

Mac OS X Mac OS X Server Mac Security Mass Deployment Xsan

MDSChannelPeerCreate and Shared Volumes

These two errors:

com.apple.AppleFileServer[8123] MDSChannelPeerCreate: (os/kern) invalid argument
MDSChannelPeerRef MDSChannelPeerCreate(CFAllocatorRef, CFDictionaryRef): (os/kern) invalid argument

I see them frequently when we’re using dynamic or shared storage (e.g. Xsan or removable media) to share volumes between multiple computers and then share those shared volumes to clients through a network sharing protocol (e.g. afp or smb). They usually mean that the system doesn’t have enough permissions to do those MDSChannelPeerCreate processes. Therefore, we need to open those permissions up a little and then let the file sharing services restart. I usually do it this way:

serveradmin stop afp
serveradmin stop smb
chown -R root:staff /Volumes/VOLUMENAME/.fseventsd
chmod -R 770 /Volumes/VOLUMENAME/.fseventsd
chown -R root:staff /Volumes/VOLUMENAME/.Spotlight-V100
chmod -R 770 /Volumes/VOLUMENAME/.Spotlight-V100
chown -R root:staff /Volumes/VOLUMENAME/.dbfseventsd
chmod -R 770 /Volumes/VOLUMENAME/.dbfseventsd
serveradmin start afp
serveradmin start smb

You can do any of the other hidden directories if that doesn’t correct the errors as well, but those are the main ones that should impact MDS. MDS is the metadata search processes, which power Spotlight. If you see these processes running at a high load then you’re likely in the process of indexing. If you see these as errors in the logs then you might not have permissions to objects. Those permissions could be to the files that are attempting to be indexed or they could be to the locations where that indexed data or other requirements are stored. While I’ve used root and staff above, take note that there’s a _spotlight user that can be used as part of an ACL. The ACE for the _spotlight user is usually enabled by default, so in the event that you get these MDS errors, it’s usually due to the fact that we, as naturally suspicious systems administrators took some permissions away somewhere or got overly cautious with our permissions. I do it all the time…

Mac OS X Server Mass Deployment Ubuntu

NFS + Ubuntu + Mac OS X Clients = A Quickie

NFS is an old standby in the *nix world. It seems that it’s about as old as the hills and while it can be cranky at times, it’s pretty easy to setup, manage and use. Once it’s configured, you use it in a similar fashion as you do in Mac OS X Server. The client configuration is identical. To get started, let’s install the nfs-kernel-server, nfs-common and portmap packages on our Ubuntu 10.04 box:

apt-get install nfs-kernel-server nfs-common portmap

Then let’s create a directory to share (aka export):

mkdir /Homes

Then we need to define the permissions for /Homes (ends up similar in functionality to the export to option in Server Admin for Mac OS X Server users):

chown nobody:nogroup /Homes

Now, let’s open up /etc/exports and allow access to Homes by configuring it as an export. To do so, paste this line in at the bottom:

/Homes        192.168.210.0/24 (rw,sync,no_subtree_check)

In the above line, we’re defining the path to the directory, followed by the address(es) that access the export. This could just be one IP address, or it could be a range of IP addresses. The above CIDR allows all IP addresses from 192.168.210.1 to 192.168.210.254 to access the export.

Now save and close the file and then run the exportfs command with the -a option (all) and you should be done with the server configuration portion:

exportfs -a

Next up, let’s port scan for nfs (port 2049) from Mac OS X using the stroke command:

/Applications/Utilities/Network Utility.app/Contents/Resources/stroke 192.168.210.254 2049 2049

Now, we need to verify that Mac OS X clients. From a client that can access the NFS server, open Disk Utility from /Applications/Utilities. Then, click on the File menu and select NFS Mounts… to bring up the NFS Mounts screen.

From the NFS Mounts screen, click on the plus sign (+) and you will see an overlay with fields for Remote NFS URL: and Mount Location:. The Remote NFS URL: field will be nfs:// followed by the name or IP of your server followed by the name of the mount you just created. The Mount Location is going to be where on the client computer that you would like the folder to be. For most scenarios, /Volumes/ followed by the name of the mount will suffice. You can see how these shake out in the following screen:

Click on Verify if it looks right and provided that the file system can be properly mounted then you’ll receive a message saying such. Then click on Save and you’re done: you should be able to browse and interact with it as needed.

Home Automation Mac OS X

Running SSH on AppleTV

Sometimes it can be really useful to have an SSH connection into your AppleTV. If I need to explain why then you probably won’t want to do it. Unless of course, you’re just after getting something like Boxee running, which we’ll look at as well. Before we get into doing anything to your AppleTV, when we’re done I do not know how Apple will feel about your warranty moving forward, so do this stuff at your own risk (but that’s pretty much true for many articles on this site)…

So first up, let’s install SSH. To get started, plug in a jump drive you don’t mind reformatting. Then run the df command and look at which filesystem that the jump drive was mounted as. In most cases this should be /dev/disk1s1 or /dev/disk2s1 or something like that. Note this location and while you’re at it, double-check that the data is trivial to you and that you really don’t mind reformatting the jump drive.

Next, let’s download atvusb-creator, a little utility that will generate a new patchstick based on that jump drive (a patchstick being the term applied to usb sticks that will hax0r an AppleTV). Once downloaded, run the tool. Select ATV-Patchstick in the Choose an Installation dialog, and then select the version of the AppleTV OS you have (if you’re fully software updated then as of the date of this writing that would be 3.x). Next, choose ssh tools from the 3rd field in the Installation Options section, making sure that the box is checked. If you are just trying to get XBMC or Boxee running then you can check the boxes for those as well at this point.

ATV USB Creator Screenshot

ATV USB Creator

Next, set the USB Target Device field to be the filesystem you selected earlier and then click the Create Using button and wait for the process to finish. Once the patchstick has been created, plug it into your AppleTV and reboot the unit. You’ll see a bunch of code, similar to starting Mac OS X into verbose mode. When the screen tells you that you’re done, unplug the patchstick and reboot the device. Upon reboot it will be running SSH with a username and password of frontrow. If you’re not using a static IP address then if you open iTunes and connect to the device you’ll have an entry in your arp table for it. You can run arp and find the IP fairly easily. Once found, use the SSH command to connect to the device. For example, if mine is on an IP address of 10.0.0.100 then I would use the following command to connect to it:

ssh frontrow@10.0.0.100

Now you have an AppleTV running SSH. Even though this article isn’t meant to be about Boxee or XBMC, you can then install those by going to the new Launcher menu and then to Downloads and downloading those applications (otherwise if you try to access them you’ll get an error that the .app bundle can’t be found). Once those are in place it should open pretty easily.

Now that you’re running SSH, let’s look at one of the uses. I want a web browser on the AppleTV (even though typing a URL in it is pretty painful unless you install a keyboard too). For this instance, I’m going to use CouchServer, ’cause I like the way the keyboard works and because there’s a silverlight that kinda’ sorta’ works with it. First, download the files for CouchSurfer here. Then copy the files that were downloaded up to the device (assuming the filename is CouchSurfer-Lite.tar) from your client computer:

scp ~/Desktop/CouchSurfer-Lite.tar frontrow@10.0.0.100:~

Next, SSH into the AppleTV and extract the tar file:

tar -xvpf CouchSurfer-Lite.tar

Then move the extracted data into the PlugIns directory (which will display the appliance similar to how Launcher would be displayed at this point:

sudo mv CouchSurfer.frappliance /System/Library/CoreServices/Finder.app/Contents/PlugIns/

(your password will be frontrow in case you have hard core add and have forgotten it already)

We’re gonna’ give ownership to wheel:

sudo chown -R root:wheel /System/Library/CoreServices/Finder.app/Contents/PlugIns/CouchSurfer.frappliance

Then reboot the AppleTV. Upon reboot, you will then have a shiny new web browser making your AppleTV even more like a full fledged Mac with Front Row. Now you’re in pretty good shape. You’ve pretty much put more stuff on your AppleTV than you can possibly use, but you still probably just want NetFlix to work on it. For that, you’ll need to get Silverlight working with CouchSurfer and just browse to the movies in the web browser at Netflix.com as the Boxee implementation for AppleTV doesn’t yet work with NetFlix and there aren’t any native Plug-Ins that work with it yet either (that I’m aware of). Also, if you’re going to use any of the 3rd party media browsers, keep in mind that they’re sitting on top of the OS layer and that their resource utilization seems pretty poor compared to the native media browser on the device (given the abstraction there, it seems logical it would be so no complaints).

BTW, another fun little app (to help make your AppleTV more like your iPad):

http://code.google.com/p/weatherfront

And the most intriguing one that I haven’t actually gotten to work yet (haven’t had time to get past the second or third step – busy) is:
http://www.appletvhacks.net/2007/04/02/install-asterisk-on-apple-tv/#more-41

What I’d like to see – the ability to run my AppleTV as a Zwave controller… Or iPad… Or Newton… :)