So, after installing the scanner (heres the notes) I then thought all would be fine. It turns out that students logging in through active directory would not be able to scan. It would not provide a preview of what was in the scanner, nor would it let you press the scan button.
On looking in the logs I found this entry:
28/03/2012 12:56:47 /System/Library/CoreServices/coreservicesd[48] removing dropped transaction for -114,_mac_bind/Library/Preferences/CanoScan LiDE 60/~SGCheck.tmp
It appears the program cannot gain the right access privilages to this folder, as it is on a Windows SMB share (I think) through active directory.
On trying to create an alias to this using OS X finder I saw this error:
28/03/2012 13:02:29 kernel smb_maperr32: no direct map for 32 bit server error (0xc0000279)
As I have NHR installed, which redirects certain folders, I thought I'd try and redirect this /Library/Preferences/CanoScan LiDE 60/ folder.
After redirecting it to the local drive, I found it still not working. I found another error:
3/28/12 1:07:52 PM /System/Library/Image Capture/Devices/TWAINBridge.app/Contents/MacOS/TWAINBridge[4423] Allocator race detected: transaction is not verified for -114/2 - _mac_bind/Library/Preferences/~SGCheck.tmp
3/28/12 1:07:55 PM /System/Library/CoreServices/coreservicesd[48] removing dropped transaction for -114,_mac_bind/Library/Preferences/~SGCheck.tmp
3/28/12 1:07:59 PM /System/Library/CoreServices/coreservicesd[48] removing dropped transaction for -114,_mac_bind/Library/Preferences/~SGCheck.tmp
3/28/12 1:07:59 PM /System/Library/CoreServices/coreservicesd[48] removing dropped transaction for -114,_mac_bind/Library/Preferences/~SGRot.tmp
It looks like it needs to write two files to the ~/Library/Preferences folder:
~SGCheck.tmp
~SGRot.tmp
I regigged the LIclean.hook to delete the Preferences folder, create it in the tmp folder on the local drive, and to create a symlink in the users Library folder.
Having done this, it worked like a dream. I would preferably have it so that it just had a symlink to these files it needs, but they are probably deleted as soon as they're not needed any more, and that would be the end of the symlink until the next login.
Anyway, for reference, here are the lines I added to the LIclean.hook file:
rm -rf "$home_loc"/Library/Preferences
mkdir /tmp/$1/Preferences
ln -s /tmp/$1/Preferences/ "$home_loc"/Library/Preferences
Thinking about it I'll also need to sort the LOcleanupclean.hook file. Here's what I need to add:
rm -rf "$home_loc"/Library/Preferences
Thats a good days work.
A catalogue of 'stuff' which somehow will help me through life by helping me remember problems I've solved, how I solved them and thoughts which will be otherwise forgotten (some of which might be of use later on).
Showing posts with label logout. Show all posts
Showing posts with label logout. Show all posts
Wednesday, 28 March 2012
Monday, 14 November 2011
Getting NHR to work on 10.6 and later
After a lot of grumbles, it turns out that there is a great need here to have NHR working again, specifically to redirect the ~/Library/Caches folders of the Active Directory networked users.
I've stated on many previous occasions when it hasn't worked with:
I decided to not have this part of the script run as to me it doesn't matter if local users also have the script running as I'm only going to have it affect the Caches folder. As such, I commented it out as well as the if statement which ran after it. This is what it ended up looking like:
After doing this it ran perfectly!!!!
A couple of things left to do:
So, I also had to change the logout script accordingly as well, commenting out the Local='dscl......... and the if statement below it. After this it all worked perfectly.
Also, a point to note is that when logged in as anyone other then root, when you add login and logout hooks it is important to understand user hooks, and all user hooks (not the correct terminology but hopefully describes what I want).
So, when logged in NOT as root, if you use the command:
it'll only give this user the hook. To do it system wide.
I've stated on many previous occasions when it hasn't worked with:
- Adobe Acrobat OS X Active Directory Crash
- OS X 10.6.6 Active Directory login Illustrator Print.ai is an unknown format
- Can't place images in Illustrator - blank box - OS X 10.6.6 Active Directory
- OS X 10.6.6 Active Directory login Illustrator Print.ai is an unknown format
- Network Home Redirector - reverting back
- Setting up the new 27" iMacs
- iMac 21.5" - 11, 2 - 10.6.6 - Installation and deployment - Part 2
- iMac 21.5" - 11, 2 - 10.6.6 - Installation and deployment
So I've finally got around to looking into why NHR hasn't been working with OS X 10.6.6.
So I installed it on a nice little MacBook Pro. Doesn't work. First I thought I'd check it installed alright and in Console I saw no errors.
Next I checked permissions and found I couldn't look in the folder /etc/hooks. I also couldn't run the script login.hook without using 'sudo'.
I logged in under root, reset the permissions so that everyone could read and write:
sudo chmod 777 /etc/login.hook
sudo chmod 777 /etc/logout.hook
sudo chmod 777 /etc/hooks
sudo chmod 777 /etc/hooks/*
Still wouldn't work.
When I tried to run the login.hook and Llcleanbasic.hook files it came up with:
LoginHook: Executing /etc/hooks/LIcleanbasic.hook...
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
After looking in the Llcleanbasic.hook file I found the first line of script ran as follows:
Local=`dscl . -list /Users |grep -x $1`Typing this in the terminal comes up with the same message, which persuades me that it is this which is throwing the whole script off. Basically this part of the script and an if statement below it, finds out if the user is listed in the local users list. It must have changed in the later versions of OS X.
I decided to not have this part of the script run as to me it doesn't matter if local users also have the script running as I'm only going to have it affect the Caches folder. As such, I commented it out as well as the if statement which ran after it. This is what it ended up looking like:
#Local=`dscl . -list /Users |grep -x $1`
#This script will re-direct several the Caches and Fonts folders from a user's network home location to the local machine to help with performance.
#if [[ "$1" == "$Local" ]]; then
# exit 0
#fi
After doing this it ran perfectly!!!!
A couple of things left to do:
- Get the logout script to work
- try is running it with it's original permissions to see if that also helped.
So, I also had to change the logout script accordingly as well, commenting out the Local='dscl......... and the if statement below it. After this it all worked perfectly.
Also, a point to note is that when logged in as anyone other then root, when you add login and logout hooks it is important to understand user hooks, and all user hooks (not the correct terminology but hopefully describes what I want).
So, when logged in NOT as root, if you use the command:
defaults write com.apple.loginwindow LoginHook /private/etc/login.hook
sudo defaults write com.apple.loginwindow LoginHook /private/etc/login.hook
Labels:
Login,
logout,
Network home redirection,
NHR,
script
Subscribe to:
Posts (Atom)