[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10. Assorted Tools

The following are additional utilities and scripts included with am-utils, and get installed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.1 am-eject

A shell script unmounts a floppy or CD-ROM that is automounted, and then attempts to eject the removable device.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.2 amd.conf-sample

A sample Amd configuration file. See section Amd Configuration File.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.3 amd2ldif

A script to convert Amd maps to LDAP input files. Use it as follows:

 
amd2ldif mapname base < amd.mapfile > mapfile.ldif

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.4 amd2sun

A script to convert Amd maps to Sun Automounter maps. Use it as follows

 
amd2sun < amd.mapfile > auto_mapfile

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.5 automount2amd

A script to convert old Sun Automounter maps to Amd maps.

Say you have the Sun automount file auto.foo, with these two lines:

 
home                  earth:/home
moon  -ro,intr        server:/proj/images

Running

 
automount2amd auto.foo > amd.foo

will produce the Amd map amd.foo with this content:

 
# generated by automount2amd on Sat Aug 14 17:59:32 US/Eastern 1999

/defaults \\
  type:=nfs;opts:=rw,grpid,nosuid,utimeout=600

home \
  host==earth;type:=link;fs:=/home \\
  rhost:=earth;rfs:=/home

moon \
  -addopts:=ro,intr \\
  host==server;type:=link;fs:=/proj/images \\
  rhost:=server;rfs:=/proj/images

This perl script will use the following /default entry

 
type:=nfs;opts:=rw,grpid,nosuid,utimeout=600

If you wish to override that, define the $DEFAULTS environment variable, or modify the script.

If you wish to generate Amd maps using the hostd (see section hostd Selector Variable) Amd map syntax, then define the environment variable $DOMAIN or modify the script.

Note that automount2amd does not understand the syntax in newer Sun Automount maps, those used with autofs.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.6 ctl-amd

A script to start, stop, or restart Amd. Use it as follows:

ctl-amd start

Start a new Amd process.

ctl-amd stop

Stop the running Amd.

ctl-amd restart

Stop the running Amd (if any), safely wait for it to terminate, and then start a new process -- only if the previous one died cleanly.

See section Run-time Administration, for more details.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.7 ctl-hlfsd

A script for controlling Hlfsd, much the same way `ctl-amd' controls Amd. Use it as follows:

ctl-hlfsd start

Start a new Hlfsd process.

ctl-hlfsd stop

Stop the running Hlfsd.

ctl-hlfsd restart

Stop the running Hlfsd (if any), wait for 10 seconds for it to terminate, and then start a new process -- only if the previous one died cleanly.

See section Hlfsd, for more details.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.8 expn

A script to expand email addresses into their full name. It is generally useful when using with the `lostaltmail' script, but is a useful tools otherwise.

 
$ expn -v ezk@example.com
ezk@example.com ->
        ezk@shekel.example.com
ezk@shekel.example.com ->
        Erez Zadok <"| /usr/local/mh/lib/slocal -user ezk || exit 75>
        Erez Zadok <\ezk>
        Erez Zadok </u/zing/ezk/.mailspool/backup>

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.9 fix-amd-map

Am-utils changed some of the syntax and default values of some variables. For example, the default value for `${os}' for Solaris 2.x (aka SunOS 5.x) systems used to be `sos5', it is now more automatically generated from `config.guess' and its value is `sunos5'.

This script converts older Amd maps to new ones. Use it as follows:

 
fix-amd-map < old.map > new.map

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.10 fixmount

`fixmount' is a variant of showmount(8) that can delete bogus mount entries in remote mountd(8) daemons. This is useful to cleanup otherwise ever-accumulating "junk". Use it for example:

 
fixmount -r host

See the online manual page for `fixmount' for more details of its usage.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.11 fixrmtab

A script to invalidate `/etc/rmtab' entries for hosts named. Also restart mountd for changes to take effect. Use it for example:

 
fixrmtab host1 host2 ...

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.12 lostaltmail

A script used with Hlfsd to resend any "lost" mail. Hlfsd redirects mail which cannot be written into the user's home directory to an alternate directory. This is useful to continue delivering mail, even if the user's file system was unavailable, full, or over quota. But, the mail which gets delivered to the alternate directory needs to be resent to its respective users. This is what the `lostaltmail' script does.

Use it as follows:

 
lostaltmail

This script needs a configuration file `lostaltmail.conf' set up with the right parameters to properly work. See section Hlfsd, for more details.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.13 lostaltmail.conf-sample

This is a text file with configuration parameters needed for the `lostaltmail' script. The script includes comments explaining each of the configuration variables. See it for more information. Also see section Hlfsd for general information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.14 mk-amd-map

This program converts a normal Amd map file into an ndbm database with the same prefix as the named file. Use it as follows:

 
mk-amd-map mapname

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.15 pawd

Pawd is used to print the current working directory, adjusted to reflect proper paths that can be reused to go through the automounter for the shortest possible path. In particular, the path printed back does not include any of Amd's local mount points. Using them is unsafe, because Amd may unmount managed file systems from the mount points, and thus including them in paths may not always find the files within.

Without any arguments, Pawd will print the automounter adjusted current working directory. With any number of arguments, it will print the adjusted path of each one of the arguments.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.16 redhat-ctl-amd

This script is similar to ctl-amd (see section ctl-amd) but is intended for Red Hat Linux systems. You can safely copy redhat-ctl-amd onto `/etc/rc.d/init.d/amd'. The script supplied by Am-utils is usually better than the one provided by Red Hat, because the Red Hat script does not correctly kill Amd processes: it is too quick to kill the wrong processes, leaving stale or hung mount points behind.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.17 wait4amd

A script to wait for Amd to start on a particular host before performing an arbitrary command. The command is executed repeatedly, with 1 second intervals in between. You may interrupt the script using `^C' (or whatever keyboard sequence your terminal's `intr' function is bound to).

Examples:

wait4amd saturn amq -p -h saturn

When Amd is up on host `saturn', get the process ID of that running Amd.

wait4amd pluto rlogin pluto

Remote login to host `pluto' when Amd is up on that host. It is generally necessary to wait for Amd to properly start and initialize on a remote host before logging in to it, because otherwise user home directories may not be accessible across the network.

wait4amd pluto

A short-hand version of the previous command, since the most useful reason for this script is to login to a remote host. I use it very often when testing out new versions of Amd, and need to reboot hung hosts.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.18 wait4amd2die

This script is used internally by `ctl-amd' when used to restart Amd. It waits for Amd to terminate. If it detected that Amd terminated cleanly, this script will return an exist status of zero. Otherwise, it will return a non-zero exit status.

The script tests for Amd's existence once every 5 seconds, six times, for a total of 30 seconds. It will return a zero exist status as soon as it detects that Amd dies.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.19 wire-test

A simple program to test if some of the most basic networking functions in am-util's library `libamu' work. It also tests the combination of NFS protocol and version number that are supported from the current host, to a remote one.

For example, in this test a machine which only supports NFS Version 2 is contacting a remote host that can support the same version, but using both UDP and TCP. If no host name is specified, `wire-test' will try `localhost'.

 
$ wire-test moisil
Network name is "mcl-lab-net.cs.columbia.edu"
Network number is "128.59.13"
Network name is "old-net.cs.columbia.edu"
Network number is "128.59.16"
My IP address is 0x7f000001.
NFS Version and protocol tests to host "moisil"...
        testing vers=2, proto="udp" -> found version 2.
        testing vers=3, proto="udp" -> failed!
        testing vers=2, proto="tcp" -> found version 2.
        testing vers=3, proto="tcp" -> failed!

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Erez Zadok on November, 27 2006 using texi2html 1.76.