While network-based home directories provide many benefits, they also can bring some unwanted headaches. These headaches usually come in the form of Microsoft Office User Data folder issues, as well as AFP performance issues when dealing with thousands, sometimes millions of cache files. If you would like to redirect some of that traffic to the local machine, instead of taxing your network and your AFP servers, NHR might be for you. Download the DMG file and choose the appropriate package installer(s) for your environment. That's it. The installer will install the scripts, set up the redirection and set a login and logout hook so that the scripts will run at every login and logout. All local users, including mobile accounts and portable home directories, will bypass the scripts and hooks. Please carefully read the detailed information below and test before deploying.


I have added in all of my packages, to take one or more of the packages that I have created, and install them on top of each other.  By default, only one script can be associated with a login hook, but by installing any of my packages, you will be able to install multiple login scripts that will all run at login.  So, if you want to use several of my packages, you don't have to try and figure out how to get them all inside of one script - simply install any of the installer packages and that package will get added to any of your existing login/logout hooks (and if you don't have any set, it will set up the current package up as a login hook).  

 

What's New in Version 3.2.3?

  1. -Fixed issue where some local admin names would cause NHR to fail

  2. -Added support for Adobe Acrobat 9

- Added support for SMART Board software (redirects ~/Library/Application Support/SMART Technologies Inc/Gallery to the local machine, if the SMART Notebook software is installed on the machine).

- Added a feature so that any existing Movies, Music and Pictures are moved to ~/Library/Application Support/NHR so that none of the existing multimedia is deleted off the server.


What's New in Version 3.1?

- Support for Office v2008 and Office v2004.  There is no support for versions prior to Office v2004.

- Requires 10.4 or 10.5 client software (10.3 is supported in NHR v3.0.2).

- Users in Workgroup Manager no longer need a login shell set for them.

- Fixed an issue where a 10.5 server would place Access Control Entries on many of the user's home folders, causing NHR to not be able to delete them and set up symlinks to the local machine.


NHR - The purpose of this package installer is to provide you with an easy way to distribute a script(s) that will redirect several files and folders from a network home user's home on the server to the local machine.  These files and folders can include Microsoft User Data, AppleWorks User Data, Caches, Fonts, Movies, Music and Pictures folders.  By redirecting these folders to the local machine, it can help with server performance, since these files and folders will "live" on the local machine and not on the server.  

 

The package installer will install clean.sh (or cleanbasic.sh or cleanmm.sh - depending on the package that you install) and cleanup.sh (or the corresponding logout hook) in the /etc/hooks folder of the local machine.  It will then set a login and logout hook on the local machine so that clean.sh (or cleanbasic.sh or cleanmm.sh - depending on the package that you install) will run at each login and cleanup.sh at each logout.  All local accounts (including mobile accounts and portable home directories) will bypass these scripts, and only users with network homes will be affected.    

 

NHRBasic.pkg simply redirects the network user's Caches and Fonts folders to the local machine (~/Library/Caches is replaced by a symlink to /tmp and ~/Library/Fonts to /Library/Fonts).  NHR.pkg redirects the network user's Caches and Fonts folders, along with the user's Microsoft User Data and AppleWorks User Data folders.  One thing that is important for this installer to work correctly, is to make sure the local admin user (the first account set up on the local machine - with UID 501), has launched all of the Office applications - Word, Excel and PowerPoint and AppleWorks.  NHRMM.pkg will do everything that NHR.pkg does, and will also redirect the network user's Movies, Music and Pictures folders to the local machine (in /Users/Shared/).  Please note that NHRMM will move the user's ~/Music, ~/Movies and ~/Pictures folders from to their home folder to ~/Library/Application Support/NHR and date and time stamp the folder.  This way, the user does not loose any of their current files in these 3 directories.  NHRUninstall.pkg is a package that will delete all of the NHR scripts from /etc/hooks.  It will not delete any other login/logout scripts you may have installed, so those will remain functional and intact (see READMENHRUninstall for more information).  CompleteUninstall.pkg will remove all scripts created by me (see READMECompleteUninstall for more information).

 

To summarize, the files listed below are installed (the installer checks to see if another NHR package has been installed, and if so, only installs the new script.

 

/etc/login.hook

/etc/logout.hook

/etc/hooks/*.hook (depending on the package installed)

/etc/hooks/masterlogin.hook

/etc/hooks/masterlogout.hook

Sets a login and logout hook (defaults write /private/var/root/Library/Preferences/com.apple.loginwindow LoginHook /etc/login.hook and logout.hook)

 

Update:  There appears to be an issue with Office redirection if there is a folder missing at the root of your network mount on the server.  The user will be able to successfully save a new document once, and after that, they will get error messages that they don't have permission to save the file to the destination.  The answer to this was found on http://macosxhints.com:  

 

http://www.macosxhints.com/article.php?story=20051122213207398

 

The fault occurs unless a folder called .TemporaryItems has been created at the root level of any mounted volume containing the saved file; so if the user's home directory is contained in an AFP share called Homes, then there has to be a directory called .TemporaryItems in the Homes folder on the server. If the home directory is on another local volume called UserData, there has to be a directory called .TemporaryItems at the root of that volume.

 

Since .TemporaryItems is a dot file, it will not be visible in the Finder. When the application is able to create this .TemporaryItems directory, it is world writable and sticky. For improved security, as long as all users are in a common group like "staff," then the folder can be restricted to writing by the group instead.

$ cd /path/to/volume/or/sharepoint

$ sudo mkdir .TemporaryItems

$ chgrp staff .TemporaryItems

$ chmod 1770 .TemporaryItems

 

Disclaimer:  Use these packages and scripts at your own risk.  Although I have complete confidence in the NHR scripts, you are reminded that use of these scripts are at your own risk without any warranty.  In no event shall I be liable for any damage that these scripts might cause.  Test these scripts out extensively before mass deploying it to your machines.

 

If you have questions or comments, please send them to jochsner1@me.com

 

Special thanks to Steve Hayman, Mike Bombich, Corey Carson and Gary Needham for helping with this project!!