generate-autohome.pl -- autohome file generator.
generate-autohome.pl [ > autohome_file]
generate-autohome.pl provides a simple command-line tool for manipulating
LDAP group information to create a home-directory automount file for autofs.
Autofs is the kernel automounter (almost complete SunOS style automounter)
under Linux (kernels 2.0.31 and higher).
The generate-autohome.pl was created to do away with the tedious task of
creating autohome files on the many (many many) linux server and workstations
in our college
generate-autohome.pl relies on the OpenLDAP utilities to get the group
information, as well as cron to run the autohomeupdate.sh. The
autohomeupdate.sh is used to backup and update the /etc/auto.home file.
generate-autohome.pl does not accept any command line options. It reads
information from an LDAP server, interprets the data and then dumps a autofs
file to standard out. This output then should be redirected into an autofs
config file. We use /etc/auto.home as a standard in
This is the location of the include file. The default value for this is
"/usr/local/etc/generate-autohome.include". Each line in the file should be
a username followed by a space then the full DNS name for a server. An
example of this would be:
This is the location of the exclude file. The default value for this is
"/usr/local/etc/generate-autohome.exclude". Each line in the file should be
a username to exclude. An example of this would be:
The exclude file has a higher priority than the include file. If a user is
in both files that person will be left out.
The DefaultMount is the default string used for mounting a home directory.
Autofs only allows one wild card in the config file, and because of this it
is usualy at the of the file.
The ldapsearchParams refers to the paramiters (or options) to send to the
ldapsearch command. We use " -x -P2 " for our current setup.
The ldapsearchArgs refers to any addtional arguments that should be sent
after the paramiters. These arguments can be used to limit the search
ldapsearch refers to the location of the ldapsearch binary. By default this
If you find a bug please let me know email me at
Copyright (C) 2003 Aaron Thompson
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA. or visit
Click here to view the source code online
Click here to download the script