aboutsummaryrefslogtreecommitdiff
path: root/contrib/amd/scripts
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1999-09-15 02:50:52 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1999-09-15 02:50:52 +0000
commit179d036e252d325d8a57a2b058c7066bdfc48869 (patch)
treebabaa2d3f02bbec865446438f974c81f18ae2607 /contrib/amd/scripts
parent75cb9b41f6a12ac4b05d08c9dcba1872400f9166 (diff)
downloadsrc-179d036e252d325d8a57a2b058c7066bdfc48869.tar.gz
src-179d036e252d325d8a57a2b058c7066bdfc48869.zip
Virgin import of AMD (am-utils) v6.0.1
Notes
Notes: svn path=/vendor/amd/dist/; revision=51292
Diffstat (limited to 'contrib/amd/scripts')
-rw-r--r--contrib/amd/scripts/amd.conf.56
-rw-r--r--contrib/amd/scripts/automount2amd.8106
-rwxr-xr-xcontrib/amd/scripts/automount2amd.in72
-rwxr-xr-xcontrib/amd/scripts/ctl-amd.in10
-rwxr-xr-xcontrib/amd/scripts/ctl-hlfsd.in4
-rwxr-xr-xcontrib/amd/scripts/lostaltmail.in5
6 files changed, 194 insertions, 9 deletions
diff --git a/contrib/amd/scripts/amd.conf.5 b/contrib/amd/scripts/amd.conf.5
index ecc88c087a6e..b1edad57ca51 100644
--- a/contrib/amd/scripts/amd.conf.5
+++ b/contrib/amd/scripts/amd.conf.5
@@ -1,5 +1,5 @@
.\"
-.\" Copyright (c) 1997-1998 Erez Zadok
+.\" Copyright (c) 1997-1999 Erez Zadok
.\" Copyright (c) 1990 Jan-Simon Pendry
.\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine
.\" Copyright (c) 1990 The Regents of the University of California.
@@ -38,7 +38,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
-.\" $Id: amd.conf.5,v 1.1.1.1 1998/11/05 02:04:58 ezk Exp $
+.\" $Id: amd.conf.5,v 1.3 1999/03/30 17:23:08 ezk Exp $
.\"
.TH AMD.CONF 8 "7 August 1997"
.SH NAME
@@ -457,7 +457,7 @@ entries (keys) they have when "df" runs. (This is accomplished by returning
non-zero values to the statfs(2) system call).
.TP
-.BR unmount_on_exist " (boolean), default=no)"
+.BR unmount_on_exit " (boolean), default=no)"
If "yes", then amd will attempt to unmount all file systems which it knows
about. Normally amd leaves all (esp. NFS) mounted file systems intact.
Note that amd does not know about file systems mounted before it starts up,
diff --git a/contrib/amd/scripts/automount2amd.8 b/contrib/amd/scripts/automount2amd.8
new file mode 100644
index 000000000000..c1c1d8baa0fd
--- /dev/null
+++ b/contrib/amd/scripts/automount2amd.8
@@ -0,0 +1,106 @@
+.\"
+.\" Copyright (c) 1997-1999 Erez Zadok
+.\" Copyright (c) 1990 Jan-Simon Pendry
+.\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine
+.\" Copyright (c) 1990 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to Berkeley by
+.\" Jan-Simon Pendry at Imperial College, London.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgment:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" %W% (Berkeley) %G%
+.\"
+.\" $Id: automount2amd.8,v 1.1 1999/08/16 01:16:36 ezk Exp $
+.\"
+.TH AUTOMOUNT2AMD 8L "24 May 1993"
+.SH NAME
+automount2amd \- converts old Sun automount maps to Amd maps
+.SH SYNOPSIS
+.B automount2amd
+.I auto.map
+.SH DESCRIPTION
+.LP
+.B automount2amd
+is used to convert an old Sun automount maps named
+.I auto.map
+to an Amd map.
+
+This perl script will use the following /default entry
+.nf
+ type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
+.fi
+If you wish to override that, define the
+.B $DEFAULTS
+environment variable, or modify the script.
+
+If you wish to generate Amd maps using the
+.I hostd
+(host domain) Amd map syntax, then define the environment variable
+.B $DOMAIN
+or modify the script.
+
+.SH EXAMPLE
+Say you have the Sun automount file auto.foo, with these two lines:
+.nf
+ home earth:/home
+ moon -ro,intr server:/proj/images
+.fi
+Running
+.nf
+ automount2amd auto.foo > amd.foo
+.fi
+will produce the Amd map
+.I amd.foo
+with this content:
+.nf
+# 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
+.fi
+.SH BUGS
+.I automount2amd
+does not understand newer Sun Automount map syntax, those used by autofs.
+.SH "SEE ALSO"
+.BR conv2amd (8), amd (8).
+.SH AUTHORS
+Original author Mike Walker <mike@tab00.larc.nasa.gov>. Script modified by
+Erez Zadok <ezk@cs.columbia.edu>, Department of Computer Science, Columbia
+University, New York, USA.
diff --git a/contrib/amd/scripts/automount2amd.in b/contrib/amd/scripts/automount2amd.in
new file mode 100755
index 000000000000..e99c74b8dd9a
--- /dev/null
+++ b/contrib/amd/scripts/automount2amd.in
@@ -0,0 +1,72 @@
+#!@PERL@ -w
+#
+# Convert Sun automount map format to amd format
+#
+# Package: am-utils-6.0
+# Author: Mike Walker <mike@tab00.larc.nasa.gov>
+# Erez Zadok <ezk@cs.columbia.edu>
+#
+# This program expects maps with the format
+#
+# dir [ -options ] machine:/path [ # optional comment ]
+# ...
+#
+# and generates an equivalent amd map as follows:
+#
+# # generated by automountamd on Fri May 21 9:16:56 1993
+#
+# /defaults \
+# type:=nfs;opts:=rw,grpid,nosuid,utimeout=600
+#
+# dir \
+# hostd==machine.larc.nasa.gov;type:=link;fs:=/path || \
+# domain==larc.nasa.gov;rhost:=machine;rfs:=/path || \
+# rhost:=machine.larc.nasa.gov;rfs:=/path
+# ...
+#
+# You should set the DOMAIN and DEFAULT variables to your preferences.
+#
+# $Id: automount2amd.in,v 1.1 1999/08/16 01:16:36 ezk Exp $
+#
+
+require "ctime.pl";
+
+# amd domain name (doesn't have to be the DNS domain; isn't overloading great!)
+# Should be what you will pass to amd via the -d command-line switch, if any.
+$DOMAIN='';
+
+# amd default settings; consult the docs for what you can/should do here.
+# Note, in particular, that if your disk mount points follow a common scheme
+# you can specify ``rfs:=/common/path/${key}'' and not have to insert that
+# line (twice) in every entry below!
+$DEFAULTS='type:=nfs;opts:=rw,grpid,nosuid,utimeout=600';
+
+
+# print comment header and default string
+printf "# generated by automount2amd on %s\n", &ctime(time);
+printf "/defaults \\\n %s\n\n", $DEFAULTS;
+
+# loop through map
+while (<>) {
+ if (m,^(\w\S*)(\s+\-\w\S*\s+|\s+)(\w[^:]*):(\/\S*)\s*(.*),) {
+ ($dir, $options, $machine, $path, $rest) = ($1, $2, $3, $4, $5);
+ print "#$rest\n" if ($rest =~ m/\w/);
+ print "$dir \\\n";
+ if ($options =~ m/-/) {
+ $options =~ s/\s//g;
+ $options =~ s/^-//g;
+ printf( " -addopts:=$options \\\n");
+ }
+ if (defined($DOMAIN) && $DOMAIN ne "") {
+ printf(" hostd==%s.%s;type:=link;fs:=%s || \\\n",
+ $machine, $DOMAIN, $path);
+ printf(" domain==%s;rhost:=%s;rfs:=%s || \\\n",
+ $DOMAIN, $machine, $path);
+ printf " rhost:=%s.%s;rfs:=%s\n\n", $machine, $DOMAIN, $path;
+ } else {
+ printf(" host==%s;type:=link;fs:=%s \\\n",
+ $machine, $path);
+ printf " rhost:=%s;rfs:=%s\n\n", $machine, $path;
+ }
+ }
+}
diff --git a/contrib/amd/scripts/ctl-amd.in b/contrib/amd/scripts/ctl-amd.in
index 8eefde27feb1..22c367792a53 100755
--- a/contrib/amd/scripts/ctl-amd.in
+++ b/contrib/amd/scripts/ctl-amd.in
@@ -5,9 +5,12 @@
# Package: am-utils-6.0
# Author: Erez Zadok <ezk@cs.columbia.edu>
#
-# chkconfig: 345 72 8
-# description: amd is the Berkeley AutoMount Daemon, used for \
-# automatic filesystem mounting
+# chkconfig: - 72 28
+# description: Runs the automount daemon that mounts devices and NFS hosts \
+# on demand.
+# processname: amd
+# config: /etc/amd.conf
+#
# set path
prefix=@prefix@
@@ -107,6 +110,7 @@ case "$1" in
echo "NOT restarting amd!"
else
echo "Restarting amd..."
+ sleep 1
ctl-amd start
fi
;;
diff --git a/contrib/amd/scripts/ctl-hlfsd.in b/contrib/amd/scripts/ctl-hlfsd.in
index e574d0d35393..ebb12b802af0 100755
--- a/contrib/amd/scripts/ctl-hlfsd.in
+++ b/contrib/amd/scripts/ctl-hlfsd.in
@@ -5,9 +5,11 @@
# Package: am-utils-6.0
# Author: Erez Zadok <ezk@cs.columbia.edu>
#
-# chkconfig: 345 73 7
+# chkconfig: - 72 28
# description: hlfsd is a daemon similar to amd, used to redirect user
# mail to home directory of the user
+# processname: hlfsd
+#
# set path
prefix=@prefix@
diff --git a/contrib/amd/scripts/lostaltmail.in b/contrib/amd/scripts/lostaltmail.in
index 5ba454c12449..8d1e6ec09d99 100755
--- a/contrib/amd/scripts/lostaltmail.in
+++ b/contrib/amd/scripts/lostaltmail.in
@@ -331,7 +331,8 @@ sub Splice_in_resent_headers {
$month=(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$utctime[4]];
- $date=sprintf("%s, %d %s %d %s UTC", $weekday, $utctime[3], $month, (($utctime[5] < 93 ? 20 : 19).$utctime[5]), $time);
+ # Ensure Y2K format
+ $date=sprintf("%s, %d %s %d %s UTC", $weekday, $utctime[3], $month, $utctime[5]+1900, $time);
$current_msg .= "$RESENT_DATE" . $date . "\n";
@@ -602,7 +603,7 @@ if ( ! $noverify ) {
printf("SMTP: address: %s port: $port\n",
join ('.',unpack('C4',$addr))) if ($debug);
- $sockaddr = pack('n2C4x8',2, $port ,unpack('C4',$addr));
+ $sockaddr = sockaddr_in($port, $addr);
printf("Sockaddr: %s\n", join (' ',unpack('C14',$sockaddr))) if ($debug);