home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / hp / 12646 < prev    next >
Encoding:
Text File  |  1992-11-08  |  15.9 KB  |  541 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!stanford.edu!rock!concert!sas!mozart.unx.sas.com!gorgon.unx.sas.com!mcm
  3. From: mcm@gorgon.unx.sas.com (Mike Mitchell)
  4. Subject: AMD mods
  5. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  6. Message-ID: <BxBHy2.3u4@unx.sas.com>
  7. Date: Fri, 6 Nov 1992 23:15:37 GMT
  8. Nntp-Posting-Host: gorgon.unx.sas.com
  9. Organization: SAS Institute Inc.
  10. Lines: 529
  11.  
  12. We've been running AMD 5.3 beta for some time, and have patched some bugs
  13. and made other changes to better support our environment of HP 700 machines
  14. running 8.07.  
  15.  
  16. We had problems with NFS RPC timeout values being set incorrectly, mounts
  17. failing while an unmount was in progress, and most recently, a mount failing
  18. within 5 minutes of an unmount.  I'm including here some patches we received
  19. to convert AMD to HPUX 8.07.
  20.  
  21. We've been using AMD for some time now, and a situation came up where I needed
  22. a selector equivalent to '${.key}'.  The key in our case contains a fully
  23. qualified hostname, i.e. 'qa.pc.sas.com' or 'warlock.dev.sas.com'.
  24. I needed to strip the hostname off and select on the domain of the key.
  25.  
  26. I added two new selectors, named '.key' and 'key.', and initialized them
  27. to the same as ${.key} and ${key.}, respectivly.  I then ran into some
  28. trouble, because sometimes ${.key} was a null string.  To correct for
  29. those cases, I set the selector .key to be "<NULL>", so I can check
  30. for it.  These changes let me use different NFS rsize and wsize parameters
  31. depending on what domain the destination machine is in.
  32. Here is an example from one of our map files:
  33.  
  34. #----------------------------------------------------------------
  35. # Wildcard match - Can't have more than 2000 bytes in this file!
  36. #
  37. *   -opts:=rw,soft,grpid,suid,rsize=1024,wsize=1024,retrans=20,timeo=10 \
  38.     hostd==${key};type:=link;fs:=.. \
  39.     host==${key};type:=link;fs:=.. \
  40.     .key==<NULL>;host!=${key};type:=host;rhost:=${key};fs:=/remote/${key.};\
  41.     opts:=rw,soft,grpid,suid,rsize=4096,wsize=4096,retrans=20,timeo=10 \
  42.     .key!=<NULL>;domain==${.key};hostd!=${key};host!=${key};type:=host;\
  43.     rhost:=${key};fs:=/remote/${key.};\
  44.     opts:=rw,soft,grpid,suid,rsize=4096,wsize=4096,retrans=20,timeo=10 \
  45.     .key!=<NULL>;.key==unx;hostd!=${key};type:=host;\
  46.     rhost:=${key};fs:=/remote/${key.};\
  47.     opts:=rw,soft,grpid,suid,rsize=4096,wsize=4096,retrans=20,timeo=10 \
  48.     .key!=<NULL>;.key==dev.sas.com;hostd!=${key};type:=host;\
  49.     rhost:=${key};fs:=/remote/${key};\
  50.     opts:=rw,soft,grpid,suid,rsize=8192,wsize=8192,retrans=20,timeo=10 \
  51.     .key!=<NULL>;.key==dev;hostd!=${key};type:=host;\
  52.     rhost:=${key};fs:=/remote/${key};\
  53.     opts:=rw,soft,grpid,suid,rsize=8192,wsize=8192,retrans=20,timeo=10 \
  54.     .key!=<NULL>;domain!=${.key};hostd!=${key};host!=${key};type:=host;\
  55.     rhost:=${key};fs:=/remote/${key};delay:=3
  56. #--------------------------------------------------------------
  57.  
  58. I don't need the 'key.' selector, but I added it for completeness.
  59. Someone might like the same approach for the 'path' selector, adding
  60. '/path' and 'path/'.
  61.  
  62. We also have many Apollos here, and need two slashes ('//') left on the
  63. end of strings.  I'm including a patch Kevin Bond added.
  64.  
  65. I've tried to send these patches off, but the mail bounces back.  Can
  66. anyone suggest the appropriate news group?  Anyway, since we deal
  67. primarily with HP's, I thought this would be a good place to start.
  68.  
  69. We are running amd.5.2.2.1 1992/02/09 15:11:18 5.3 beta #7, and here
  70. are the context diffs:
  71.  
  72. *** amd/afs_ops.c    Tue Oct  6 15:46:03 1992
  73. --- amd/afs_ops.c.orig    Sun Feb  9 10:07:53 1992
  74. ***************
  75. *** 185,196 ****
  76.       if (strlen(fs_hostname) >= HOSTNAMESZ)
  77.           strcpy(fs_hostname + HOSTNAMESZ - 3, "..");
  78.   #endif /* HOSTNAMESZ */
  79. - #ifdef NFSMNT_FSNAME
  80. -     nfs_args.fsname = pid_fsname;
  81. -     nfs_args.flags |= NFSMNT_FSNAME;
  82. - #endif /* NFSMNT_FSNAME */
  83.   
  84.       /*
  85.        * Parse a subset of the standard nfs options.  The
  86.        * others are probably irrelevant for this application
  87. --- 185,191 ----
  88. ***************
  89. *** 905,913 ****
  90.            * Note whether this is a real mount attempt
  91.            */
  92.           if (p == &efs_ops) {
  93. - #ifdef DEBUG
  94.               plog(XLOG_MAP, "Map entry %s for %s failed to match", *cp->ivec, mp->am_path);
  95. - #endif
  96.               if (this_error <= 0)
  97.                   this_error = ENOENT;
  98.               continue;
  99. --- 900,906 ----
  100. ***************
  101. *** 1271,1277 ****
  102.                   continue;
  103.               }
  104.   
  105. !             if (!(mf->mf_flags & MFF_MOUNTED) || (mf->mf_flags & MFF_UNMOUNTING)) {
  106.   in_progrss:
  107.                   /*
  108.                    * If the fs is not mounted or it is unmounting then there
  109. --- 1264,1270 ----
  110.                   continue;
  111.               }
  112.   
  113. !             if (!(mf->mf_flags & MFF_MOUNTED) /*|| (mf->mf_flags & MFF_UNMOUNTING)*/) {
  114.   in_progrss:
  115.                   /*
  116.                    * If the fs is not mounted or it is unmounting then there
  117. ***************
  118. *** 1284,1292 ****
  119.                   dlog("ignoring mount of %s in %s -- in progress",
  120.                       fname, mf->mf_mount);
  121.   #endif /* DEBUG */
  122. - if (mf->mf_flags & MFF_UNMOUNTING){
  123. - plog(XLOG_WARNING, "ignoring mount of %s in %s -- unmount in progress", fname,
  124. - mf->mf_mount);}
  125.                   in_progress++;
  126.                   continue;
  127.               }
  128. --- 1277,1282 ----
  129. *** amd/host_ops.c    Mon Sep 28 11:41:27 1992
  130. --- amd/host_ops.c.orig    Sun Feb  9 10:08:05 1992
  131. ***************
  132. *** 247,262 ****
  133.       char fs_name[MAXPATHLEN], *rfs_dir;
  134.       char mntpt[MAXPATHLEN];
  135.       struct timeval tv;
  136. ! /*
  137. !  * The original 10 second per try timeout is WAY too large, especially
  138. !  * if we're only waiting 10 or 20 seconds max for the response.
  139. !  * That would mean we'd try only once in 10 seconds, and we could
  140. !  * lose the transmitt or receive packet, and never try again.
  141. !  * A 2-second per try timeout here is much more reasonable.
  142. !  * 09/28/92 Mike Mitchell, mcm@unx.sas.com
  143. !  *    tv.tv_sec = 10; tv.tv_usec = 0;
  144. !  */
  145. !      tv.tv_sec = 2; tv.tv_usec = 0;
  146.   
  147.       /*
  148.        * Read the mount list
  149. --- 247,253 ----
  150.       char fs_name[MAXPATHLEN], *rfs_dir;
  151.       char mntpt[MAXPATHLEN];
  152.       struct timeval tv;
  153. !     tv.tv_sec = 10; tv.tv_usec = 0;
  154.   
  155.       /*
  156.        * Read the mount list
  157. ***************
  158. *** 306,314 ****
  159.       tv2.tv_sec = 10; tv2.tv_usec = 0;
  160.       clnt_stat = clnt_call(client, MOUNTPROC_EXPORT, xdr_void, 0, xdr_exports, &exlist, tv2);
  161.       if (clnt_stat != RPC_SUCCESS) {
  162. -         extern char *clnt_sperrno();
  163. -         char *msg = clnt_sperrno(clnt_stat);
  164. -         plog(XLOG_ERROR, "host_fmount rpc failed: %s", msg);
  165.           /*clnt_perror(client, "rpc");*/
  166.           error = EIO;
  167.           goto out;
  168. --- 297,302 ----
  169. *** amd/info_hes.c    Fri May  8 10:29:52 1992
  170. --- amd/info_hes.c.orig    Sun Feb  9 10:08:09 1992
  171. ***************
  172. *** 459,465 ****
  173.           cp += sizeof(u_short);
  174.           /* Check to see if key is in our domain */
  175.           if (type == T_TXT && hs_strip_our_domain(key)) {
  176. !             value = hs_make_value((unsigned char *)cp, len);
  177.               if (value == NULL)
  178.                   return(-1);
  179.               key_cpy = strdup(key);
  180. --- 459,465 ----
  181.           cp += sizeof(u_short);
  182.           /* Check to see if key is in our domain */
  183.           if (type == T_TXT && hs_strip_our_domain(key)) {
  184. !             value = hs_make_value(cp, len);
  185.               if (value == NULL)
  186.                   return(-1);
  187.               key_cpy = strdup(key);
  188. ***************
  189. *** 500,510 ****
  190.   
  191.   char *
  192.   hs_make_value(cp, len)
  193. ! unsigned char *cp;
  194.   int len;
  195.   {
  196. !     char *value, *valuep;
  197. !     unsigned char *cpcpy;
  198.       int cnt, nextcnt, totalcnt, lencpy;
  199.   #ifdef DEBUG
  200.       char *dbgname;
  201. --- 500,509 ----
  202.   
  203.   char *
  204.   hs_make_value(cp, len)
  205. ! char *cp;
  206.   int len;
  207.   {
  208. !     char *value, *cpcpy, *valuep;
  209.       int cnt, nextcnt, totalcnt, lencpy;
  210.   #ifdef DEBUG
  211.       char *dbgname;
  212. *** amd/mntfs.c    Wed Sep 23 17:46:39 1992
  213. --- amd/mntfs.c.orig    Sun Feb  9 10:08:22 1992
  214. ***************
  215. *** 175,187 ****
  216.                    */
  217.                   if (mf->mf_ops != &efs_ops)
  218.                       continue;
  219. -             /*
  220. -              * following two lines added to prevent AMD
  221. -              * from hanging.  Suggested by:
  222. -              * cagney@cs.adelaide.edu.au (Andrew Cagney)
  223. -              */
  224. -                 else
  225. -                     return dup_mntfs(mf);
  226.               } else /* ops != &efs_ops */ {
  227.                   /*
  228.                    * If the existing ops are efs_ops
  229. --- 175,180 ----
  230. *** amd/nfs_ops.c    Fri Mar 27 12:41:00 1992
  231. --- amd/nfs_ops.c.orig    Sun Feb  9 10:08:27 1992
  232. ***************
  233. *** 530,540 ****
  234.       if (strlen(host) >= HOSTNAMESZ)
  235.           strcpy(host + HOSTNAMESZ - 3, "..");
  236.   #endif /* HOSTNAMESZ */
  237. - #ifdef NFSMNT_FSNAME
  238. -     nfs_args.fsname = fs_name;
  239. -     nfs_args.flags |= NFSMNT_FSNAME;
  240. - #endif /* NFSMNT_FSNAME */
  241.   
  242.       if (nfs_args.rsize = hasmntval(&mnt, "rsize"))
  243.           nfs_args.flags |= NFSMNT_RSIZE;
  244. --- 530,535 ----
  245. *** amd/opts.c    Wed Jul 15 14:21:50 1992
  246. --- amd/opts.c.orig    Sun Feb  9 10:08:35 1992
  247. ***************
  248. *** 43,49 ****
  249.   
  250.   #include "am.h"
  251.   
  252. ! extern char *getenv P((Const char *));
  253.   
  254.   /*
  255.    * static copy of the options with
  256. --- 43,49 ----
  257.   
  258.   #include "am.h"
  259.   
  260. ! extern char *getenv P((const char *));
  261.   
  262.   /*
  263.    * static copy of the options with
  264. ***************
  265. *** 54,63 ****
  266.   static char *opt_host = hostname;
  267.   static char *opt_hostd = hostd;
  268.   static char nullstr[] = "";
  269. - static char NullStr[] = "<NULL>";
  270.   static char *opt_key = nullstr;
  271. - static char *opt_dkey = NullStr;
  272. - static char *opt_keyd = nullstr;
  273.   static char *opt_map = nullstr;
  274.   static char *opt_path = nullstr;
  275.   
  276. --- 54,60 ----
  277. ***************
  278. *** 103,110 ****
  279.       { S("cache"), &fs_static.opt_cache, 0 },
  280.       { S("user"), &fs_static.opt_user, 0 },
  281.       { S("group"), &fs_static.opt_group, 0 },
  282. -     { S(".key"), 0, &opt_dkey },
  283. -     { S("key."), 0, &opt_keyd },
  284.       { S("var0"), &vars[0], 0 },
  285.       { S("var1"), &vars[1], 0 },
  286.       { S("var2"), &vars[2], 0 },
  287. --- 100,105 ----
  288. ***************
  289. *** 245,254 ****
  290.               /*
  291.                * No value, just continue
  292.                */
  293. ! #ifdef DEBUG
  294. !             plog(XLOG_USER, "key %s: No value component in \"%s\"",
  295. !                     mapkey, f);
  296. ! #endif
  297.               continue;
  298.           }
  299.   
  300. --- 240,246 ----
  301.               /*
  302.                * No value, just continue
  303.                */
  304. !             plog(XLOG_USER, "key %s: No value component in \"%s\"", mapkey, f);
  305.               continue;
  306.           }
  307.   
  308. ***************
  309. *** 302,315 ****
  310.                   case SelEQ:
  311.                   case SelNE:
  312.                       if (op->sel_p && (STREQ(*op->sel_p, opt) == (vs_opt == SelNE))) {
  313. - #ifdef DEBUG
  314.                           plog(XLOG_MAP, "key %s: map selector %s (=%s) did not %smatch %s",
  315.                               mapkey,
  316.                               op->name,
  317.                               *op->sel_p,
  318. !                             vs_opt == SelNE ? "(not) " : "",
  319.                               opt);
  320. - #endif
  321.                           return 0;
  322.                       }
  323.                       break;
  324. --- 294,305 ----
  325.                   case SelEQ:
  326.                   case SelNE:
  327.                       if (op->sel_p && (STREQ(*op->sel_p, opt) == (vs_opt == SelNE))) {
  328.                           plog(XLOG_MAP, "key %s: map selector %s (=%s) did not %smatch %s",
  329.                               mapkey,
  330.                               op->name,
  331.                               *op->sel_p,
  332. !                             vs_opt == SelNE ? "not " : "",
  333.                               opt);
  334.                           return 0;
  335.                       }
  336.                       break;
  337. ***************
  338. *** 746,752 ****
  339.   /*
  340.    * Remove trailing /'s from a string
  341.    * unless the string is a single / (Steven Glassman)
  342. -  * or unless it is two slashes // (Kevin D. Bond)
  343.    */
  344.   void deslashify P((char *s));
  345.   void deslashify(s)
  346. --- 736,741 ----
  347. ***************
  348. *** 754,761 ****
  349.   {
  350.       if (s && *s) {
  351.           char *sl = s + strlen(s);
  352. -         if ( *s == '/' && s[1] == '/' )
  353. -             s++;
  354.           while (*--sl == '/' && sl > s)
  355.               *sl = '\0';
  356.       }
  357. --- 743,748 ----
  358. ***************
  359. *** 783,801 ****
  360.       opt_map = map;
  361.       opt_path = path;
  362.   
  363. -     opt_dkey = strchr(key, '.');
  364. -     if (!opt_dkey) {
  365. -         opt_dkey = NullStr;
  366. -         opt_keyd = key;
  367. -     }
  368. -     else {
  369. -         opt_keyd = strnsave(key, opt_dkey - key);
  370. -         opt_dkey++;
  371. -         if (*opt_dkey == '\0')    /* check for 'host.' */
  372. -         opt_dkey = NullStr;
  373. -     }
  374.       /*
  375.        * Expand global options
  376.        */
  377. --- 770,775 ----
  378. ***************
  379. *** 853,862 ****
  380.       /*
  381.        * Clear defined options
  382.        */
  383. -     if (opt_keyd != key && opt_keyd != nullstr)
  384. -         free(opt_keyd);
  385. -     opt_keyd = nullstr;
  386. -     opt_dkey = NullStr;
  387.       opt_key = opt_map = opt_path = nullstr;
  388.   
  389.       return ok;
  390. --- 827,832 ----
  391. *** amd/srvr_nfs.c    Tue Nov  3 19:40:00 1992
  392. --- amd/srvr_nfs.c.orig    Sun Feb  9 10:08:47 1992
  393. ***************
  394. *** 641,667 ****
  395.   
  396.       ITER(fs, fserver, &nfs_srvr_list) {
  397.           if (STREQ(host, fs->fs_host)) {
  398. -             /*
  399. -              * following if statement from Mike Mitchell
  400. -              * <mcm@unx.sas.com>
  401. -              * Initialize the ping data if we are no longer
  402. -              * pinging.  The np_ttl and np_ping fields are
  403. -              * especially important.
  404. -              */
  405. -             if (!(fs->fs_flags & FSF_PINGING)) {
  406. -                 np = (nfs_private *) fs->fs_private;
  407. -                 np->np_mountd_inval = TRUE;
  408. -                 np->np_xid = NPXID_ALLOC();
  409. -                 np->np_error = -1;
  410. -                 np->np_ping = 0;
  411. -                 /*
  412. -                  * Initially the server will be deemed dead
  413. -                  * after MAX_ALLOWED_PINGS of the fast variety
  414. -                  * have failed.
  415. -                  */
  416. -                 np->np_ttl = MAX_ALLOWED_PINGS * FAST_NFS_PING +
  417. -                         clocktime() - 1;
  418. -             }
  419.               start_nfs_pings(fs, pingval);
  420.               fs->fs_refc++;
  421.               return fs;
  422. --- 641,646 ----
  423. *** amq/amq.c    Fri Oct  2 11:53:35 1992
  424. --- amq/amq.c.orig    Sun Feb  9 10:08:57 1992
  425. ***************
  426. *** 408,419 ****
  427.       s = privsock(SOCK_STREAM);
  428.       clnt = clnttcp_create(&server_addr, AMQ_PROGRAM, AMQ_VERSION, &s, 0, 0);
  429.       if (clnt == 0) {
  430. -         struct timeval tv;
  431.           close(s);
  432.           s = privsock(SOCK_DGRAM);
  433. !         tv.tv_sec  = 2;        /* 2 seconds per retry */
  434. !         tv.tv_usec = 0;
  435. !         clnt = clntudp_create(&server_addr, AMQ_PROGRAM, AMQ_VERSION, tv, &s);
  436.       }
  437.       if (clnt == 0) {
  438.           fprintf(stderr, "%s: ", progname);
  439. --- 408,416 ----
  440.       s = privsock(SOCK_STREAM);
  441.       clnt = clnttcp_create(&server_addr, AMQ_PROGRAM, AMQ_VERSION, &s, 0, 0);
  442.       if (clnt == 0) {
  443.           close(s);
  444.           s = privsock(SOCK_DGRAM);
  445. !         clnt = clntudp_create(&server_addr, AMQ_PROGRAM, AMQ_VERSION, TIMEOUT, &s);
  446.       }
  447.       if (clnt == 0) {
  448.           fprintf(stderr, "%s: ", progname);
  449. *** config/Makefile.hpux    Fri Mar 27 12:41:23 1992
  450. --- config/Makefile.hpux.orig    Sun Feb  9 10:10:06 1992
  451. ***************
  452. *** 44,50 ****
  453.   
  454.   #CC = gcc ${GCCOPTS}
  455.   # Works only on HP300
  456. ! #CC = cc -Wc,-Nd2000
  457. ! #SYSCC = $(CC)
  458.   # Works only Hp800
  459. ! CC = cc -Aa -D_HPUX_SOURCE -Dhp9000s800 -Dhp9000s700
  460. --- 44,50 ----
  461.   
  462.   #CC = gcc ${GCCOPTS}
  463.   # Works only on HP300
  464. ! CC = cc -Wc,-Nd2000
  465. ! SYSCC = $(CC)
  466.   # Works only Hp800
  467. ! # CC = cc
  468. *** config/misc-hpux.h    Fri Mar 27 12:41:31 1992
  469. --- config/misc-hpux.h.orig    Sun Feb  9 10:10:04 1992
  470. ***************
  471. *** 77,81 ****
  472.   #define    NFSMNT_HOSTNAME    0x020    /* set hostname for error printf */
  473.   #define    NFSMNT_INT    0x040    /* set option to have interruptable mounts */
  474.   #define    NFSMNT_NODEVS   0x080   /* turn off device file access (default on) */
  475. - #define NFSMNT_FSNAME   0x100   /* provide name of server's fs to system */
  476. --- 77,79 ----
  477. *** config/os-hpux.h    Fri May  8 09:54:48 1992
  478. --- config/os-hpux.h.orig    Sun Feb  9 10:10:03 1992
  479. ***************
  480. *** 133,143 ****
  481.    */
  482.   #define FIXUP_MNTENT(mntp) { \
  483.       (mntp)->mnt_time = clocktime(); \
  484. -     (mntp)->mnt_cnode = 0; \
  485.   }
  486.   #define FIXUP_MNTENT_DUP(mntp, mp) { \
  487.       (mntp)->mnt_time = (mp)->mnt_time; \
  488. -     (mntp)->mnt_cnode = (mp)->mnt_cnode; \
  489.   }
  490.   
  491.   #define    bzero(ptr, len)    memset(ptr, 0, len)
  492. --- 133,141 ----
  493. *** include/config.h    Fri May  8 10:21:27 1992
  494. --- include/config.h.orig    Sun Feb  9 10:09:36 1992
  495. ***************
  496. *** 137,142 ****
  497.   extern void plog ();
  498.   /*extern void plog P((int, char*, ...));*/
  499.   extern void show_opts P((int ch, struct opt_tab*));
  500. ! extern char* strchr P((Const char*, int)); /* C */
  501.   extern voidp xmalloc P((int));
  502.   extern voidp xrealloc P((voidp, int));
  503. --- 137,142 ----
  504.   extern void plog ();
  505.   /*extern void plog P((int, char*, ...));*/
  506.   extern void show_opts P((int ch, struct opt_tab*));
  507. ! extern char* strchr P((const char*, int)); /* C */
  508.   extern voidp xmalloc P((int));
  509.   extern voidp xrealloc P((voidp, int));
  510. *** rpcx/amq.x    Fri May  8 10:25:23 1992
  511. --- rpcx/amq.x.orig    Sun Feb  9 10:09:00 1992
  512. ***************
  513. *** 45,51 ****
  514.    * Protocol description used by the amq program
  515.    */
  516.   
  517. ! Const AMQ_STRLEN = 1024;    /* Maximum length of a pathname */
  518.   
  519.   /*
  520.    * The type dirpath is the pathname of a directory
  521. --- 45,51 ----
  522.    * Protocol description used by the amq program
  523.    */
  524.   
  525. ! const AMQ_STRLEN = 1024;    /* Maximum length of a pathname */
  526.   
  527.   /*
  528.    * The type dirpath is the pathname of a directory
  529. ====================================================================
  530. End of patches.
  531. -- 
  532. ------------------------------------------------------------------------------
  533. Mike Mitchell            "There's laughter where I used to see a tear.
  534. mcm@unx.sas.com             It's all done with mirrors, have no fear."
  535. (919) 677-8000 X6793            -- Blue Oyster Cult
  536.