Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

OS X Login Script Help Needed

I think I'm posting this in the correct location.

Here's what I have. I'm trying to get past the issue with Adobe Reader not working under network accounts. The problem is that when a network user logs in and tries to launch Reader it crashes almost immediately. I've found that if I move the 9.0_ppc directory to the /Users/Shared directory of the local Mac and then create a symbolic link to it in the ~/Library/Application Support/Adobe/Acrobat directory that it works just fine under the network accounts. Problem is there are too many accounts to do this to feasibly.

So what I'm trying to figure out how to do is create a login script that will apply to all users. This script should automatically delete the /Library/Application Support/Adobe/Acrobat/9.0_ppc directory and replace it with a symbolic link to the /Users/Shared/9.0_ppc directory.

Seems like this should be a relatively easy task but has proven to be quite challenging.

My server is running OS X Server 10.5.8 and my workstations are running 10.4.11

MBP Core duo, Mac OS X (10.6.1), B&W G4, iMac FP, and a few others

Posted on Sep 29, 2009 12:11 PM

Reply
14 replies

Sep 29, 2009 1:19 PM in response to B Man

The magic word you need:

loginhook

This is a place where you can attach a script as the user logs in. You are still the root user for the duration of the script, but immediately after the script ends you become the logging-in user.

HT2420- Mac OS X: Creating a login hook

One "famous" loginhook for moving user caches off the Server and onto the workstation's Hard drive is described in this mailing list item. If you lift it, note that there is a space missing in one line of code, but i think a later reader comments on that.

Re: Network home folders slow-down (redirecting cache?)

Oct 4, 2009 7:59 PM in response to nightfire2

I had trouble getting that script to produce the correct homedirectory reference. I modified the script to print out the complete path to the user's homedirectory, and found it was goofed up (null, I think). I was finally able to beat on it enough to get the correct homedirectory, and then it just worked from then on.

When you modify the script, it will not run again until you re-set execute permission for the script. Also, the author admits that he actually hard-coded his servername in his production system.

Oct 5, 2009 11:45 AM in response to nightfire2

In re-reading your post, I had another thought. If you are in fact pointing to the correct cache folder, it could be a permissions issue.

I used WorkGroup Manager to change permissions for all my Users, to Owner (=User) Read/Write; Group (=Admin) Read/Write; Everyone - No Access. Then propagated that through their folders. When i want to change something, or get access to do backups, I have no permissions issues. (The only file that seems to defy backup is their Address Book database, because the program seems to change the permissions to group - No Access.)

Oct 5, 2009 4:17 PM in response to Grant Bennet-Alder

You are quite right, When I run the script as the local user it works wonderfully and there are no problems. The problem comes when the local root tries to change stuff on the network share(login scripts are executed as local root) which is administrated by a different user/password. If there was a way to get the script to execute as the local user or some how authenticate with the server in the script that would be awesome.

Oct 6, 2009 4:43 AM in response to nightfire2

First, be sure that the script is generating a valid reference to the User folder required. Mine was not, and it took some work to get a valid, complete reference. The simplest way to check this is to add some more prints that show you the complete home directory reference.

If the Root user on a Workstation is a member of the admin group (which it is by default) there is no issue changing User files and folders on items on the Server that also have their basic group set to admin with Read/Write access. No additional scripts are needed -- it works.

Oct 6, 2009 7:26 PM in response to Grant Bennet-Alder

Okay I checked, and the script is generating the correct path.
Here is an anonymized version of the script for you to look at

#! /bin/sh

home="/Network/Servers/server.school.edu/Volumes/Storage/Student/"$1

echo $home > acrobat9fix.log

`rm -rf /Users/Shared/9.0_x86`
`mkdir /Users/Shared/9.0_x86`
`rm -rf $home/Library/Application\ Support/Adobe/Acrobat/9.0_x86`
`ln -s /Users/Shared/9.0_x86 $home/Library/Application\ Support/Adobe/Acrobat`

exit 0

Oct 7, 2009 8:09 AM in response to nightfire2

The example cache_locally script requires the adjustment of permissions on only one place -- /Library/Caches/
...to allow the creation of a new cache folder for each <username>.
In my opinion, adjusting permissions in that folder on a workstation is of negligible consequences.

Now you are talking about adjusting permissions in a much more sensitive folder,
"/Library/Application Support/"
... and you are doing it in support of Adobe Acrobat, when (in my opinion) superior Preview application requires no such compromise.

I think you are over-thinking and over-tooling this one. Just moving the Caches off the Server is a big improvement. You can stop there, in my opinion.

If you need more, think about transitioning key teacher-owned or similar workstations to Portable Home Directories.

Oct 8, 2009 10:17 PM in response to Grant Bennet-Alder

Okay... This is for a design lab which uses Acrobat pro for publishing PDF's something preview falls far short of. If I were to move the caches off the server then each machine would be cluttered with user files/folders I would prefer that only the bare minimum of data be stored on the client. I appreciate your help but I need a way to modify folders on the server with this script.

OS X Login Script Help Needed

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.