Go to the first, previous, next, last section, table of contents.


10 Assorted Tools

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

10.1 am-eject

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

10.2 amd.conf-sample

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

10.3 amd2ldif

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

amd2ldif mapname base < amd.mapfile > mapfile.ldif

10.4 amd2sun

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

amd2sun < amd.mapfile > auto_mapfile

10.5 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 7 Run-time Administration for more details.

10.6 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 9 Hlfsd for more details.

10.7 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@cs.columbia.edu
ezk@cs.columbia.edu ->
        ezk@shekel.mcl.cs.columbia.edu
ezk@shekel.mcl.cs.columbia.edu ->
        Erez Zadok <"| /usr/local/mh/lib/slocal -user ezk || exit 75>
        Erez Zadok <\ezk>
        Erez Zadok </u/zing/ezk/.mailspool/backup>

10.8 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

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

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

10.11 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 9 Hlfsd for more details.

10.12 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 9 Hlfsd for general information.

10.13 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

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

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

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

10.17 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!


Go to the first, previous, next, last section, table of contents.