Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
LDAP-UX Client Services B.04.10 with Microsoft Windows Active Directory Administrator's Guide: HP-UX 11i v1 and v2 > Chapter 4 LDAP-UX Client Services with AutoFS Support

AutoFS Migration Scripts

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

This section describes the migration scripts which can be used to migrate your AutoFS maps from files to LDIF files. After LDIF files are created, you can use the ldapmodify tool to import LDIF files to your LDAP directory server. These migration scripts use the new automount schema defined in RFC 2307-bis to migrate the AutoFS maps to LDIF. You need to import the new automount schema into your LDAP directory server before you use these migration scripts to migrate AutoFS maps.

Table 4-2 describes the migration scripts located in the /opt/ldapux/migrate/ads directory:

Table 4-1 Migration Scripts

Migration ScriptDescription
migrate_automount_ads.plMigrates AutoFS maps from files to LDIF.
migrate_nis_automount_ads.plMigrates AutoFS maps form the NIS server to LDIF.

 

Environment Variables

When you use the AutoFS migration scripts to migrate AutoFS maps, set the following environment variables:

LDAP_BASEDN

The base distinguished name of the LDAP directory server that the AutoFS maps are to be placed in.

NIS_DOMAINNAME

This variable specifies the fully qualified name of the NIS domain where you want to migrate your data from. This variable is optional. If the NIS domain name is not specified, LDAP-UX uses the value of the NIS_DOMAIN parameter configured in the /etc/rc.conf.d/namesvrs file.

This variable is only used by the migrate_nis_automount.pl script.

Examples

The following command sets the base DN to "dc=example, dc=hp, dc=com":

export LDAP_BASEDN="example.hp.com"
 

The following command sets the fully qualified name of the NIS domain to "example.hp.com":

export NIS_DOMAINNAME="example.hp.com"
 

General Syntax For Migration Scripts

The migration scripts use the following general syntax:

scriptname inputfile outfile

where

scriptname

Is the name of the particular script you are using.

inputfile

Is the fully qualified file name of the appropriate AutoFS map that you want to migrate. For example, /etc/auto_master.

outputfile

This is optional and is the name of the file where the LDIF is written. stdout is the default output.

The migrate_automount_ads.pl Script

This script, found in /opt/ldapux/migrate/ads, migrates the AutoFS maps from files to LDIF.

Syntax

scriptname inputfile outputfile

Examples

The following commands migrate the AutoFS map /etc/auto_direct to LDIF and place the results in the /tmp/auto_direct.ldif file:

export LDAP_BASEDN="dc=nishpind"
migrate_automount_ads.pl /etc/auto_direct /tmp/auto_direct.ldif

The following shows an example of the /etc/auto_direct file:

#local mount point          remote server:directory
/mnt/direct/lab1                   hostA:/tmp
/mnt/direct/lab2                   hostB:/tmp

The following shows the resulting /tmp/auto_direct.ldif file:

dn:cn=auto_direct,dc=nishpind
objectClass: top
objectClass: automountMap
automountMapName: auto_direct
cn: auto_direct

dn:cn=/mnt_direct/lab1,cn=auto_direct,dc=nishpind
objectClass: top
objectClass: automount
automountInformation:hostA:/tmp 
automountKey: /mnt_direct/lab1
cn: /mnt_direct/lab1
dn:cn=/mnt_direct/lab2,cn=auto_direct,dc=nishpind
objectClass: top
objectClass: automount
automountInformation:hostB:/tmp
automountKey: /mnt_direct/lab2
cn: /mnt_direct/lab2

You can use the /opt/ldapux/bin/ldapmodify tool to import the LDIF file /tmp/auto_direct.ldif that you just created above into the LDAP directory. For example, the following command imports the /tmp/auto_direct.ldif file to the LDAP base DN "dc=nishpind" in the LDAP directory server LDAPSERV1:

/opt/ldapux/bin/ldapmodify -a -h LDAPSERV1 -D "cn=Directory Manager" \
-w <passwd> -f /tmp/auto_direct.ldif

Where options are:

-a Add a new entry into the LDAP directory

-h The LDAP directory host name

-D The Distinguish Name (DN) of the directory manager

-w The password of the directory manager

-f The LDIF file to be imported into the LDAP directory

The migrate_nis_automount_ads.pl Script

This script, found in /opt/ldapux/migrate/ads, migrates the AutoFS maps from the NIS server to LDIF.

Syntax

scriptname inputfile outputfile

Examples

The following commands migrate the AutoFS map /etc/auto_indirect to LDIF and place the results in the /tmp/auto_indirect.ldif file:

export LDAP_BASEDN="dc=nisserv1"
export NIS_DOMAINNAME="example.hp.com"
migrate_nis_automount_ads.pl /etc/auto_indirect  /tmp/auto_indirect.ldif

The following shows an example of the /etc/auto_indirect file:

#local mount point          remote server:directory
lab1                            hostA:/tmp
lab2                            hostB:/tmp

The following shows the resulting /tmp/auto_indirect.ldif file:

dn:cn=auto_indirect,dc=nisserv1
objectClass: top
objectClass: automountMap
automountMapName: auto_indirect
cn: auto_indirect

dn:cn=lab1,cn=auto_indirect, dc=nisserv1
objectClass: top
objectClass: automount
automountInformation: hostA:/tmp 
automountKey: lab1
cn: lab1
dn:cn=lab2,cn=auto_indirect,dc=nisserv1
objectClass: top
objectClass: automount
automountInformation: hostB:/tmp
automountKey: lab2
cn: lab2

You can use the /opt/ldapux/bin/ldapmodify tool to import the LDIF file /tmp/auto_indirect.ldif that you just created above into the LDAP directory. For example, the following command imports the /tmp/auto_indirect.ldif file to the LDAP base DN "dc=nisserv1" in the LDAP directory server LDAPSERV1:

/opt/ldapux/bin/ldapmodify -a -h LDAPSERV1 -D "cn=Directory Manager" \
-w <passwd> -f /tmp/auto_indirect.ldif
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2006 Hewlett-Packard Development Company, L.P.