[92] in 6.033-lab

home help back first fref pref prev next nref lref last post

mounting in places other than /sfs

daemon@ATHENA.MIT.EDU (Miro Jurisic)
Mon Apr 13 17:42:39 1998

Date: Sun, 12 Apr 1998 17:41:01 -0400
To: 6.033-lab@MIT.EDU
From: Miro Jurisic <meeroh@MIT.EDU>

I noticed that sometimes my server crashes, but the mountpoint remains
busy. I haven't been able to find a way to deal with this under Solaris in
a way other than rebuilding sfslaunch to use a different mountpoint. So, I
decided it would be a lot better if there were a command line argument to
sfslaunch telling it where to mount sfs.

The new syntax is

sfslaunch [-m mountpoint] client [clientargs]

For example

sfslaunch -m /test sfsfs/sfsfs /tmp/disk

will run sfsfs and mount /tmp/disk to /test. You still need to create /test
(for which you'll porbably have to be root).

The diffs that make this work follow.

Hth,

meeroh

Index: clntmgr.c
===================================================================
RCS file: /cvs/6.033-filesystem/sfslaunch/clntmgr.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 clntmgr.c
*** clntmgr.c	1998/04/12 01:04:49	1.1.1.1
--- clntmgr.c	1998/04/13 21:37:16
***************
*** 47,53 ****
      asvc_serve (c->cd_nfssvc, NFS_PROGRAM, NFS_VERSION,
  		rpctbl (nfs_program, 2));

!     nfsunmount (SFSROOT, 1, automounter_unmount_cb, NULL);
      return;
    }

--- 47,53 ----
      asvc_serve (c->cd_nfssvc, NFS_PROGRAM, NFS_VERSION,
  		rpctbl (nfs_program, 2));

!     nfsunmount (sfsroot, 1, automounter_unmount_cb, NULL);
      return;
    }

***************
*** 89,95 ****
      fatal ("clientd: %s\n", clnt_sperrno (err));
    }

!   nfsmount(SFSROOT, &c->cd_nfssin, &c->cd_nfssin,
  	   &ms->mr.sfscd_mountres_u.rootfh, "(sfs)",
  	   mount_cb, ms);

--- 89,95 ----
      fatal ("clientd: %s\n", clnt_sperrno (err));
    }

!   nfsmount(sfsroot, &c->cd_nfssin, &c->cd_nfssin,
  	   &ms->mr.sfscd_mountres_u.rootfh, "(sfs)",
  	   mount_cb, ms);

Index: sfslaunch.c
===================================================================
RCS file: /cvs/6.033-filesystem/sfslaunch/sfslaunch.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 sfslaunch.c
*** sfslaunch.c	1998/04/12 01:04:50	1.1.1.1
--- sfslaunch.c	1998/04/13 21:37:16
***************
*** 12,17 ****
--- 12,19 ----

  int sfs_ending;

+ char sfsroot[256] = SFSROOT;
+
  static void
  cleanup_and_dead (void *_null)
  {
***************
*** 76,85 ****
    fatalhook = sfscd_fatalhook;

    if (argc < 2) {
!     fatal ("Usage: sfslaunch clientd [clientd args]");
    }

!   av = vectorize_argv (argv + 1, argc - 1);

    client.cd_argv = av;

--- 78,91 ----
    fatalhook = sfscd_fatalhook;

    if (argc < 2) {
!     fatal ("Usage: sfslaunch [-m mountpoint] clientd [clientd args]");
    }

!   if (strcmp(argv[1], "-m") == 0) {
!     strcpy(sfsroot, argv[2]);
!     av = vectorize_argv (argv + 3, argc - 3);
!   } else
!     av = vectorize_argv (argv + 1, argc - 1);

    client.cd_argv = av;

Index: sfslaunch.h
===================================================================
RCS file: /cvs/6.033-filesystem/sfslaunch/sfslaunch.h,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 sfslaunch.h
*** sfslaunch.h	1998/04/12 01:04:50	1.1.1.1
--- sfslaunch.h	1998/04/13 21:37:16
***************
*** 8,13 ****
--- 8,15 ----

  extern int sfs_ending;

+ extern char sfsroot[];
+
  struct clientd {
    struct clientd *cd_next;	/* All clientd's */
    char **cd_argv;               /* How to invoke client */

"The last good thing written in C was Franz Schubert's Symphony number 9."
                Erwin Dieterich



home help back first fref pref prev next nref lref last post