Showing posts with label symbolic link. Show all posts
Showing posts with label symbolic link. Show all posts

Wednesday, 28 March 2012

Canon LiDE 60 on OS X 10.6.6 and Active Directory probs

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.

Wednesday, 15 February 2012

iTunes Apps folder on OS X

So, I've been downloading a few new apps for the iPads and have just been notified that I'm using too much disk space. So, looking into where the apps are stored I found this folder:

~Music/iTunes/iTunes\ Media/Mobile\ Applications

Thought I'd move this to the local drive and make a symlink:

ln -s /Volumes/Scratch\ Disk/Stephen/Mobile\ Applications /Network/Servers/appleton.chesterfield.ac.uk/home2\$/LeachS/Music/iTunes/iTunes\ Media

Yep, still works. So all is good.

Tuesday, 24 January 2012

OS X 10.6.6 Printer Queues won't open

After trialing the UniFlow MacClient popup (not currently working though) I noticed that when a print job was sent to a queue the little printer icon would not appear on the dock. I did notice it on local logins but my login is from Active Directory.

After a little investigation it was noticed that the printers in my ~/Library/Printers I was getting a large list of duplicate printer names:



This was a permissions issue. I made a symlink to a local folder:
ln -s /Users/Shared/localPrinterFolder ~/Library/

I logged out and back in and printers were opening like a dream.

Monday, 12 December 2011

iTunes iPad backup location

I've noticed my Library folder get immensely large. I looked into it with OmnDiskSweeper (now that WhatSize has decided to charge) and found nearly 800MB (not much nowadays but too much for this as far as ICT Services goes) was taken up with iPad backups:

/Library/Application\ Support/MobileSync/Backup

I thought the easiest solution was to move it to the local scratch disk and symbolically link it. Heres the exact command I used to create the symbolic link:


ln -s /Volumes/Scratch\ Disk/Stephen/Library/Application\ Support/MobileSync/Backup /Network/Servers/appleton.chesterfield.ac.uk/home2\$/LeachS/Library/Application\ Support/MobileSync 

Seems to have done the trick.

I also noticed another folder taking up a lot of disk space whenever I tried to do a software update for the iPads:

/Volumes/Scratch\ Disk/Stephen/Library/iTunes/iPad Software Updates/

I decided to move the whole /Library/iTunes folder across. Here's the command I used to create a symbolic link:

ln -s /Volumes/Scratch\ Disk/Stephen/Library/iTunes /Network/Servers/appleton.chesterfield.ac.uk/home2\$/LeachS/Library

Monday, 21 November 2011

Making Symbolic links on Mac OS X through command line

So, I keep having to refer back to this, so instead of looking through old posts which mention it, I thought I'd make a post dedicated to Symbolic links.

So, to make a symbolic link it is simply:

ln -s /pathtoexistingfolder/ /pathtofolderyouwantsyboliclinkin/

Simple. Of course many occasions call for you to use the command line to check whether a folder is a symbolic link. To do this I use this command:

ls -l ~/Library/

If a folder in this list starts with an 'l' it means it is a symbolic link. I run this command to check whether the Caches folder is a symbolic link:

ls -l ~/Library/ | grep 'Caches'

What comes up if it is a symbolic link is:

lrwx------ 1 330986 wheel 19 Nov 21 11:37 Caches -> /tmp/330986/Caches/

Notice the "l" at the begining, and also the " -> " which then tells us where the symbolic link goes to.

Tuesday, 15 November 2011

Why NHR didn't work! Finally

So, after many, many trials and tribulations I've finally worked out why NHR wasn't working. Simply because I tried to install it over itself. Basically the files were already there. Doh!

So to fix it in all the mac suites I basically have to:

  1. Get rid of the NHR files on't computers
    1. run the uninstall file
    2. run a small script to delete the /etc/hooks and /etc/login.hook and /etc/logout.hook
  2. Install the NHR.pkg file again (through task server)
So, as I'm running it all through the task server anyway, I'll try and line up the uninstall and install files sequentially, so that it works in the right order. It should do.


Done 

Tuesday, 1 November 2011

Can't place images in Illustrator - blank box - OS X 10.6.6 Active Directory

I had this problem a few years ago, and it's recently popped up again. The problem is that when Active Directory Users (with home drives on Windows servers) try and place a picture within an Illustrator document, they just get a blank box with an X through it.

The way I found in fixing it previously was to install NHR (previously documented in my blog), which basically replaces the ~/Library/Caches folder with a symlink to a temporary folder on the local hard drive. It then deleted this when the networked user logged out.

The trouble I'm having now is that I can't get NHR to work with OS X 10.6.6. It simply doesn't want to run on login, maybe not even at all. The work around that I'm formulating is to simply make a little shell script which runs at login and does what NHR did.

I've now made a little Automator application which runs the terminal script:


mkdir /Users/Shared/temp
mkdir /Users/Shared/temp/Caches
rm -R ~/Library/Caches
ln -s /Users/Shared/temp/Caches ~/Library/



This has fixed the problem with the users who run the Automator Application, although when they login to a machine which doesn't have this "/Users/Shared/temp/Caches" folder they will encounter problems.

I shall make a new post describing how I made the startup script.