Search:

How to Install and Configure attach

For help or if you have questions or problems, please contact the Solution Center, 195 Durham Center, solution@iastate.edu or call IT Services at 294-4000.

Table of Contents
About attach
System Requirements
Installing attach
Configuring attach
    AFS Mounting
    URL Mounting
LoginHook/LogoutHook Scripts

About attach

attach can perform these functions:

  • mount (*) one or more AFS directories
  • mount one or more server shares

These functions can be combined together or performed separately. When executed at login, attach can be used to mount the necessary directories or shares for the user that is logging in.

The default configuration file will mount your AFS home directory on the Desktop. See the appropriate sections below for instructions on what to modify to alter this default behavior.

(*) AFS directories are not actually mounted. OpenAFS mounts the afs volume and the attach application creates a folder that points to the AFS directory you specify (i.e. a short-cut). Without this short-cut, you would have to browse down deep into the afs volume to get to the AFS directory you wanted to access.

System Requirements

These programs are currently only supported on Mac OS X 10.4 and Mac OS X 10.5 systems, but have worked correctly in the past on both the Mac OS X 10.2 and Mac OS X 10.3 systems.

If mounting an AFS directory, OpenAFS must be installed and configured. See How to Install and Configure OpenAFS.

Kerberos must also be enabled and configured (for Keberos 5).
You may want to also install MIT's Mac OS X Kerberos Extras.
See How to Configure Kerberos.

Installing attach

IT Services has put together an installer that will install:

  • the attach configuration file (edu.iastate.attach.plist in ~/Library/Preferences)
  • the detach script and other support programs (in /usr/athena/etc)
  • the (Iowa State based) hesiod configuration file (in /etc)

You can download IT Services' installer from here (356 KB downlaod).

To install, follow these steps:

  1. Double-click on the attach.pkg package installer to install the software required by attach.

  2. Drag the attach application to the Applications folder (/Applications) on your hard disk.

  3. If you want the attach application to execute during login, add the attach application to your System Preferences -> Accounts -> Login Items list.

  4. If you are mounting AFS directories at login, then you may want to also configure your system to use the "detach" script (which will unmount the AFS directories at logout).

    If you previously installed pvattach and followed the old instructions to edit the /etc/ttys file to manually to add the "LogoutHook", undo that edit now:

    sudo pico -w /etc/ttys
    

    • change (all as one line):

      console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
      −LogoutHook /usr/athena/etc/pvdetach"
      vt100 on secure window=/System/Library/CoreServices/WindowServer
      onoption="/usr/libexec/getty std.9600"
      

    • to (all as one line):

      console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow"
      vt100 on secure window=/System/Library/CoreServices/WindowServer
      onoption="/usr/libexec/getty std.9600"
      

    We no longer recommend editing the /etc/ttys file directly.

    The "defaults write" command is the preferred method to install login and logout hooks:

    sudo defaults write /Library/Preferences/com.apple.loginwindow \
    LogoutHook "/usr/athena/etc/logouthook"
    

Configuring attach

The default attach configuration file, edu.iastate.attach.plist, is installed by attach.pkg (if it doesn't already exist). This default configuration will mount the user's home AFS directory on the desktop. You will need to alter attach's configuration file if you do not want this default behavior. The configuration file can be edited by the "Property List Editor" program, from the command line using vi or pico, or by an editor program. The "Property List Editor" program is installed from the "Xcode Tools" package installer.

AFS Mounting

AFS Mounting is defined in the 'AFSMount" section of attach's configuration file.

<key>AFSMount</key>
<array>
  <string>afs local</string>
</array>

One or more <string>afs local</string> statements can be defined.

Where:

  • afs

    • can be ~ that represents the user's AFS home directory,
    • can be ~locker that represents the locker's AFS home directory,
    • can be a fully quailified AFS directory path.

  • local

    • can be ~/path that represents a path in the user's local home directory,
    • can be a fully qualified local directory path.

AFS Mounting Examples:

  • <string>~ ~/Desktop/$USER</string>

    Mount the user's AFS home directory on the user's desktop as "$USER", where "$USER" is replaced by the user's login username.

  • <string>~ ~macosx ~/Desktop/macsox</string>

    Mount the the macosx AFS locker on the user's desktop as "macosx".

URL Mounting

URL Mounting (i.e. AFP, SMB, etc.) is defined in the 'URLMount" section of attach's configuration file.

<key>URLMount</key>
<array>
  <string>url[ local]</string>
</array>

One or more <string>url[ local]</string> statements can be defined. The url[ local] part means that local is optional. Do not specify the [ ]'s.

Where:

  • url

    • can be afp://server/share that represents a share on an AFP server,
    • can be smb://server/share that represents a share on an SMB server,
    • can be ftp://server/share that represents a share on an FTP server (mounted read-only)

    The full URL syntax can be specified:

    afp://[username[:password]@]server/share[/path]
    smb://[[domain;]username[:password]@]server/share[/path]
    ftp://[user[:password]@]server/share[/path]

    However, it is not recommended that you store the password in the configuration file. Replace all blanks in url with the string "%20".

  • local

    • can be ~/path that represents a path in the user's local home directory,
    • can be a fully qualified local directory path. local is optional. If not specified, no short-cut folder is created.

URL Mounting Examples:

  • <string>afp://afpserver.fqdn.iastate.edu/volume</string>

    Mount the AFP server's volume. No short-cut folder is created.

  • <string>smb://smbserver.fqdn.iastate.edu/volume/$USER ~/Desktop/$USER</string>

    Mount the SMB server's volume and create a folder on the desktop that points to the user's folder in this volume on this server.

LoginHook/LogoutHook Scripts

A login hook script (/usr/athena/etc/loginhook) and a logout hook script (/usr/athena/etc/logouthook) are installed as part of the attach installer distributed by IT Services. At logout, the folder placed on the desktop by "attach" is deleted by "detach" (the logout hook script calls "detach"). If you don't want this behaviour or if you want to perform additional steps on logout, you can alter the logout hook script. In addition, if you want to perform steps at login, you should alter the login hook script. Both of these scripts are written in Perl.

Last updated October 21, 2009