Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 1998 15:06:53 -0700 (PDT)
From:      dhw@whistle.com
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   conf/6387: /etc/rc* amd config -- one more level of indirection, please?
Message-ID:  <199804222206.PAA02725@pau-amma.whistle.com>

next in thread | raw e-mail | index | archive | help

>Number:         6387
>Category:       conf
>Synopsis:       Need to hack /etc/rc.network to use NIS-resident amd maps
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 22 15:10:01 PDT 1998
>Last-Modified:
>Originator:     David Wolfskill
>Organization:
Whistle Communications
>Release:        FreeBSD 2.2.6-BETA i386
>Environment:

FreeBSD 2.2.5 +, actually.  Using NIS for amd maps.

>Description:

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.

>How-To-Repeat:

	
I don't think I want to think about this part....  :-)

>Fix:

[I fudged the below rcsdiffs slightly -- I elided the $Id$ changes, for
example.  Also, one of the changes to rc.conf was strictly cosmetic --
reducing the numbers of tabs before the comment.  However, I did remove
the "-p" flag from amd_flags, because /etc/rc.network already has the -p
flag.  The critical thing is adding "amd_map_prog" to /etc/rc.conf, and
adding the 3 lines to /etc/rc.network to check for a value, and if there
is one, use it.  Granted, there's no check to see if what's there is
sensible... but the admin could scramble the amd flags, as well; the
mind boggles....  Please also note that the "amd_map_prog" could be a
pipeline; one of the machines here is using

amd_map_prog="ypcat -k amd.master | sed -e 's#^/usr/local #/usr/local.shrimp #'"

for example.  dhw]

shrimp[42]% foreach f (conf network)
foreach? rcsdiff -c -r1.1 rc.$f
foreach? end
===================================================================
RCS file: RCS/rc.conf,v
retrieving revision 1.1
diff -c -r1.1 rc.conf
*** rc.conf     1998-04-03 11:10:49-08  1.1
--- rc.conf     1998-04-13 07:52:51-07
***************
*** 49,56 ****
                                # a slave kerberos server
  kerberos_stash=""             # Is the kerberos master key stashed?
  rwhod_enable="NO"             # Run the rwho daemon (or NO).
! amd_enable="YES"                      # 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"
  nfs_client_enable="YES"               # This host is an NFS client (or NO).
  nfs_client_flags="-n 4"               # Flags to nfsiod (if enabled).
  nfs_server_enable="YES"               # This host is an NFS server (or NO).
--- 49,57 ----
                                # a slave kerberos server
  kerberos_stash=""             # Is the kerberos master key stashed?
  rwhod_enable="NO"             # Run the rwho daemon (or NO).
! amd_enable="YES"              # Run amd service with $amd_flags (or NO).
! amd_flags="-nr -k i386 -l syslog -x all"
+ amd_map_prog="ypcat -k amd.master"
  nfs_client_enable="YES"               # This host is an NFS client (or NO).
  nfs_client_flags="-n 4"               # Flags to nfsiod (if enabled).
  nfs_server_enable="YES"               # This host is an NFS server (or NO).
===================================================================
RCS file: RCS/rc.network,v
retrieving revision 1.1
diff -c -r1.1 rc.network
*** rc.network  1998-04-03 11:10:49-08  1.1
--- rc.network  1998-04-03 11:15:55-08
***************
*** 229,234 ****
--- 229,237 ----
  
      if [ "X${amd_enable}" = X"YES" ]; then
            echo -n ' amd'
+           if [ "X${amd_map_prog}" != "X" ]; then
+               amd_flags="${amd_flags} `${amd_map_prog}`"
+           fi
            amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null
      fi

>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804222206.PAA02725>