From 4cb3dec38f372e7458999e474c3fed49260472f4 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sun, 26 Apr 1998 06:32:13 +0000 Subject: [PATCH] Jean-Simon Pendry's paper on amd refers to the use of "ypcat -k" against the "master map" to get the list of mount point/amd map correspondences, and using that list as command-line arguments to start amd. When I tried to do this with the existing /etc/rc* scripts, I found that I couldn't do this by modifying only /etc/rc.conf: that file gets sourced very early by /etc/rc, well before any networking functionality is present, let alone NIS. Further, I wasn't able to figure out a way to use various levels & types of quoting to defer evaluation of the string to a point subsequent to NIS initialization. As a result, I resorted to hacking /etc/rc.network -- but I did it in a way that ought to be reasonably general, and avoid breakage for anyone else. PR: 6387 Reviewed by: phk Submitted by: David Wolfskill --- etc/network.subr | 5 ++++- etc/rc.conf | 3 ++- etc/rc.d/netoptions | 5 ++++- etc/rc.d/network1 | 5 ++++- etc/rc.d/network2 | 5 ++++- etc/rc.d/network3 | 5 ++++- etc/rc.d/routing | 5 ++++- etc/rc.network | 5 ++++- 8 files changed, 30 insertions(+), 8 deletions(-) diff --git a/etc/network.subr b/etc/network.subr index e43b9d4ba049..9e0211f00078 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.21 1998/04/12 09:47:43 markm Exp $ +# $Id: rc.network,v 1.22 1998/04/18 10:27:06 brian Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -238,6 +238,9 @@ network_pass3() { if [ "X${amd_enable}" = X"YES" ]; then echo -n ' amd' + if [ "X${amd_map_program}" != X"NO" ]; then + amd_flags="${amd_flags} `${amd_map_program}`" + fi amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null fi diff --git a/etc/rc.conf b/etc/rc.conf index a18aa3c6e8b7..2a7ed4621c0a 100644 --- a/etc/rc.conf +++ b/etc/rc.conf @@ -6,7 +6,7 @@ # # All arguments must be in double or single quotes. # -# $Id: rc.conf,v 1.44 1998/04/12 09:47:41 markm Exp $ +# $Id: rc.conf,v 1.45 1998/04/18 10:27:04 brian Exp $ ############################################################## ### Important initial Boot-time options ##################### @@ -54,6 +54,7 @@ kerberos_stash="" # Is the kerberos master key stashed? rwhod_enable="NO" # Run the rwho daemon (or NO). amd_enable="NO" # Run amd service with $amd_flags (or NO). amd_flags="-a /net -c 1800 -k i386 -d my.domain -l syslog /host /etc/amd.map" +amd_map_program="NO" # Can be set to "ypcat -k amd.master" nfs_client_enable="NO" # This host is an NFS client (or NO). nfs_client_flags="-n 4" # Flags to nfsiod (if enabled). nfs_server_enable="NO" # This host is an NFS server (or NO). diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions index e43b9d4ba049..9e0211f00078 100644 --- a/etc/rc.d/netoptions +++ b/etc/rc.d/netoptions @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.21 1998/04/12 09:47:43 markm Exp $ +# $Id: rc.network,v 1.22 1998/04/18 10:27:06 brian Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -238,6 +238,9 @@ network_pass3() { if [ "X${amd_enable}" = X"YES" ]; then echo -n ' amd' + if [ "X${amd_map_program}" != X"NO" ]; then + amd_flags="${amd_flags} `${amd_map_program}`" + fi amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null fi diff --git a/etc/rc.d/network1 b/etc/rc.d/network1 index e43b9d4ba049..9e0211f00078 100644 --- a/etc/rc.d/network1 +++ b/etc/rc.d/network1 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.21 1998/04/12 09:47:43 markm Exp $ +# $Id: rc.network,v 1.22 1998/04/18 10:27:06 brian Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -238,6 +238,9 @@ network_pass3() { if [ "X${amd_enable}" = X"YES" ]; then echo -n ' amd' + if [ "X${amd_map_program}" != X"NO" ]; then + amd_flags="${amd_flags} `${amd_map_program}`" + fi amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null fi diff --git a/etc/rc.d/network2 b/etc/rc.d/network2 index e43b9d4ba049..9e0211f00078 100644 --- a/etc/rc.d/network2 +++ b/etc/rc.d/network2 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.21 1998/04/12 09:47:43 markm Exp $ +# $Id: rc.network,v 1.22 1998/04/18 10:27:06 brian Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -238,6 +238,9 @@ network_pass3() { if [ "X${amd_enable}" = X"YES" ]; then echo -n ' amd' + if [ "X${amd_map_program}" != X"NO" ]; then + amd_flags="${amd_flags} `${amd_map_program}`" + fi amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null fi diff --git a/etc/rc.d/network3 b/etc/rc.d/network3 index e43b9d4ba049..9e0211f00078 100644 --- a/etc/rc.d/network3 +++ b/etc/rc.d/network3 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.21 1998/04/12 09:47:43 markm Exp $ +# $Id: rc.network,v 1.22 1998/04/18 10:27:06 brian Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -238,6 +238,9 @@ network_pass3() { if [ "X${amd_enable}" = X"YES" ]; then echo -n ' amd' + if [ "X${amd_map_program}" != X"NO" ]; then + amd_flags="${amd_flags} `${amd_map_program}`" + fi amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null fi diff --git a/etc/rc.d/routing b/etc/rc.d/routing index e43b9d4ba049..9e0211f00078 100644 --- a/etc/rc.d/routing +++ b/etc/rc.d/routing @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.21 1998/04/12 09:47:43 markm Exp $ +# $Id: rc.network,v 1.22 1998/04/18 10:27:06 brian Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -238,6 +238,9 @@ network_pass3() { if [ "X${amd_enable}" = X"YES" ]; then echo -n ' amd' + if [ "X${amd_map_program}" != X"NO" ]; then + amd_flags="${amd_flags} `${amd_map_program}`" + fi amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null fi diff --git a/etc/rc.network b/etc/rc.network index e43b9d4ba049..9e0211f00078 100644 --- a/etc/rc.network +++ b/etc/rc.network @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.21 1998/04/12 09:47:43 markm Exp $ +# $Id: rc.network,v 1.22 1998/04/18 10:27:06 brian Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -238,6 +238,9 @@ network_pass3() { if [ "X${amd_enable}" = X"YES" ]; then echo -n ' amd' + if [ "X${amd_map_program}" != X"NO" ]; then + amd_flags="${amd_flags} `${amd_map_program}`" + fi amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null fi