aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* updatedr4-54Matt Wilson1999-10-122-1/+7
* *** empty log message ***r4-53Bill Nottingham1999-10-112-1/+8
* add support for linuxconf aliasesBill Nottingham1999-10-111-4/+42
* *** empty log message ***r4-52Bill Nottingham1999-10-112-1/+5
* fix for Jensens.Bill Nottingham1999-10-111-0/+4
* *** empty log message ***r4-51Bill Nottingham1999-10-062-1/+5
* *** empty log message ***Bill Nottingham1999-10-061-1/+1
* fix it. Really, we mean it.Bill Nottingham1999-10-061-1/+3
* *** empty log message ***r4-50Bill Nottingham1999-10-053-1/+7
* control stop-a like magic sysrqBill Nottingham1999-10-053-3/+12
* *** empty log message ***Bill Nottingham1999-10-052-1/+15
* *** empty log message ***Bill Nottingham1999-10-051-1/+5
* If /etc/sysconfig/keyboard is not present (on serial console), don't complain.Jakub Jelinek1999-10-051-1/+3
* check for aumix-minimal before executionBill Nottingham1999-10-042-2/+2
* duh. can we say, duplicated functionality?Bill Nottingham1999-10-024-92/+2
* *** empty log message ***r4-49Bill Nottingham1999-09-302-1/+36
* save for laterBill Nottingham1999-09-301-6/+0
* wow, that was broken. I wonder how it worked before.Bill Nottingham1999-09-301-1/+1
* warn if there's a service we can't kill.Bill Nottingham1999-09-301-0/+6
* add an extra awk check to make sure we omit root fs.Bill Nottingham1999-09-291-2/+2
* req. e2fsprogs >= 1.15Bill Nottingham1999-09-291-1/+1
* recover if dead daemon left pidfileMichael K. Johnson1999-09-281-3/+10
* exit after deleting pidfile...Michael K. Johnson1999-09-281-1/+1
* really fix pidfile locking...Michael K. Johnson1999-09-281-31/+9
* proper file lockingMichael K. Johnson1999-09-281-2/+20
* *** empty log message ***r4-48Bill Nottingham1999-09-261-0/+11
* typoBill Nottingham1999-09-261-1/+1
* *** empty log message ***Bill Nottingham1999-09-242-1/+30
* use fsck's completion barBill Nottingham1999-09-241-2/+2
* locale: C -> en_USBill Nottingham1999-09-242-4/+13
* new versionr4-47Michael K. Johnson1999-09-231-2/+3
* kill nicely, try to hang up modemMichael K. Johnson1999-09-231-1/+37
* be more careful about killingMichael K. Johnson1999-09-231-1/+2
* make ppp-watch kill leftover dialer more reliablyMichael K. Johnson1999-09-232-1/+24
* update man page to document config fileBill Nottingham1999-09-231-2/+24
* *** empty log message ***r4-46Bill Nottingham1999-09-214-3/+30
* add a "DEFRAG_IPV4" settingBill Nottingham1999-09-211-1/+36
* new version 4.45r4-45Michael K. Johnson1999-09-211-1/+4
* changed defaultsMichael K. Johnson1999-09-211-4/+2
* *** empty log message ***r4-44Bill Nottingham1999-09-202-6/+9
* add sys-unconfig man pageBill Nottingham1999-09-202-0/+33
* just run 'passwd root'Bill Nottingham1999-09-201-3/+1
* look in /proc/cpuinfo for arc consoleBill Nottingham1999-09-201-9/+17
* *** empty log message ***Bill Nottingham1999-09-203-2/+14
* *** empty log message ***Bill Nottingham1999-09-201-1/+1
* don't dup stdin.Bill Nottingham1999-09-201-1/+0
* pass /dev/null as stdin to daemons.Bill Nottingham1999-09-201-1/+1
* Don't run rc.local through initlog.Bill Nottingham1999-09-201-1/+1
* add note about conflicts with gated.Bill Nottingham1999-09-201-0/+2
* just call swapoff oncer4-43Bill Nottingham1999-09-201-5/+3
> } break; default: break; } return (TRUE); } bool_t xdr_dirpath(XDR *xdrs, dirpath *objp) { if (!xdr_string(xdrs, objp, MNTPATHLEN)) { return (FALSE); } return (TRUE); } static int nfs_mount_version = 3; /* kernel >= 2.1.32 */ /* *********** TODO for kernel 2.4, nfs-mount version 4 */ int nfsmount_prepare(const char *spec, int *flags, char **mount_opts) { char hostdir[1024]; CLIENT *mclient; char *hostname, *dirname; fhandle root_fhandle; struct timeval total_timeout; enum clnt_stat clnt_stat; static struct nfs_mount_data data; struct sockaddr_in server_addr; struct sockaddr_in mount_server_addr; int msock, fsock; struct timeval retry_timeout; struct fhstatus status; char *s; int port; msock = fsock = -1; mclient = NULL; strncpy(hostdir, spec, sizeof(hostdir)); if ((s = (strchr(hostdir, ':')))) { hostname = hostdir; dirname = s + 1; *s = '\0'; } else { log_message("nfsmount: format not host:dir"); goto fail; } server_addr.sin_family = AF_INET; /* first, try as IP address */ if (!inet_aton(hostname, &server_addr.sin_addr)) { /* failure, try as machine name */ if (mygethostbyname(hostname, &server_addr.sin_addr)) goto fail; } memcpy (&mount_server_addr, &server_addr, sizeof (mount_server_addr)); /* Set default options. * timeo is filled in after we know whether it'll be TCP or UDP. */ memset(&data, 0, sizeof(data)); data.retrans = 3; data.acregmin = 3; data.acregmax = 60; data.acdirmin = 30; data.acdirmax = 60; data.rsize = 8192; data.wsize = 8192; data.bsize = 8192; #if NFS_MOUNT_VERSION >= 2 data.namlen = NAME_MAX; #endif #if NFS_MOUNT_VERSION >= 3 if (nfs_mount_version >= 3) data.flags |= NFS_MOUNT_NONLM; /* HACK HACK msw */ #endif /* Adjust options if none specified */ if (!data.timeo) data.timeo = 7; /* udp */ data.version = nfs_mount_version; *mount_opts = (char *) &data; if (*flags & MS_REMOUNT) return 0; retry_timeout.tv_sec = 3; retry_timeout.tv_usec = 0; total_timeout.tv_sec = 20; total_timeout.tv_usec = 0; /* contact the mount daemon via TCP */ mount_server_addr.sin_port = htons(0); msock = RPC_ANYSOCK; mclient = clnttcp_create(&mount_server_addr, MOUNTPROG, MOUNTVERS, &msock, 0, 0); /* if this fails, contact the mount daemon via UDP */ if (!mclient) { mount_server_addr.sin_port = htons(0); msock = RPC_ANYSOCK; mclient = clntudp_create(&mount_server_addr, MOUNTPROG, MOUNTVERS, retry_timeout, &msock); } if (mclient) { /* try to mount hostname:dirname */ mclient->cl_auth = authunix_create_default(); clnt_stat = clnt_call(mclient, MOUNTPROC_MNT, (xdrproc_t) xdr_dirpath, (caddr_t) &dirname, (xdrproc_t) xdr_fhstatus, (caddr_t) &status, total_timeout); if (clnt_stat != RPC_SUCCESS) { if (errno != ECONNREFUSED) { log_message(clnt_sperror(mclient, "mount")); goto fail; /* don't retry */ } log_message(clnt_sperror(mclient, "mount")); auth_destroy(mclient->cl_auth); clnt_destroy(mclient); mclient = 0; close(msock); } } else goto fail; if (status.fhs_status != 0) { if (status.fhs_status == 2) log_message("NFS server says: No such file or directory"); else if (status.fhs_status == 13) log_message("NFS server says: Permission denied"); else log_message("nfsmount prepare failed, reason given by server: %d", status.fhs_status); goto fail; } memcpy((char *) &root_fhandle, (char *) status.fhstatus_u.fhs_fhandle, sizeof (root_fhandle)); /* create nfs socket for kernel */ fsock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (fsock < 0) { log_perror("nfs socket"); goto fail; } if (bindresvport(fsock, 0) < 0) { log_perror("nfs bindresvport"); goto fail; } server_addr.sin_port = PMAPPORT; port = pmap_getport(&server_addr, NFS_PROGRAM, NFS_VERSION, IPPROTO_UDP); if (port == 0) port = NFS_PORT; #ifdef NFS_MOUNT_DEBUG else log_message("used portmapper to find NFS port\n"); log_message("using port %d for nfs deamon\n", port); #endif server_addr.sin_port = htons(port); /* prepare data structure for kernel */ data.fd = fsock; memcpy((char *) &data.root, (char *) &root_fhandle, sizeof (root_fhandle)); memcpy((char *) &data.addr, (char *) &server_addr, sizeof(data.addr)); strncpy(data.hostname, hostname, sizeof(data.hostname)); /* clean up */ auth_destroy(mclient->cl_auth); clnt_destroy(mclient); close(msock); return 0; /* abort */ fail: if (msock != -1) { if (mclient) { auth_destroy(mclient->cl_auth); clnt_destroy(mclient); } close(msock); } if (fsock != -1) close(fsock); return -1; }