Welcome to Aaron Thompson's Page Tuesday, October 13 2015 @ 12:08 CDT  
Contact Info
probability project
Perl Modules
Win32::AD::User (cpan)
backup_file (source)
chkconfig (source)
gen-autohome (source)
group-utils (source)
mail-deny (source)
mail-logs (source | archive)
mailman-qmail (source)
qmail vacation (source)
Beast of Burden LLC
Central Iowa LUG
ITS Home
UNI Home


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 CNS


    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: 
        ->thompson math-cs.cns.uni.edu<-

    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
    is "/usr/bin/ldapsearch".

Report a Bug

If you find a bug please let me know email me at thompson@cns.uni.edu.

Download / Source

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 version.

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 details.

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 http://www.gnu.org/copyleft/gpl.html

Click here to view the source code online

Click here to download the script