From 0f58e47551345d7c48c9404bc4188f7fc195e51a Mon Sep 17 00:00:00 2001 From: amavect Date: Wed, 18 Aug 2021 17:51:40 +0000 Subject: exportfs, oexportfs, iostats: make -d log to stderr exportfs -d logs 9p traffic to /tmp/exportdb. -f allows writing to a different file. exportfs silently continues if it doesn't have permissions to create or write to /tmp/exportdb. These are poor behaviors. A better default is to write to stderr, since it is 9P debug info that is better immediately printed, and not user info that is better handled by syslog(). As a result, -f is obsolete and thus removed. Redirect responsibility is now on rc. As a side effect, rc will fail if it doesn't have permissions to write. exportfs(4) is updated to reflect all changes and with a better Synopsis. oexportfs is changed to match exportfs. oexportfs(4) is updated to reflect all changes. The Synopsis is not changed due to the number of flags. Removed -f from iostats. iostats(4) is updated to reflect all changes. --- --- sys/src/cmd/iostats.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'sys/src/cmd/iostats.c') diff --git a/sys/src/cmd/iostats.c b/sys/src/cmd/iostats.c index 421f531a9..cd32239ff 100644 --- a/sys/src/cmd/iostats.c +++ b/sys/src/cmd/iostats.c @@ -6,7 +6,6 @@ #include #include -#define DEBUGFILE "iostats.out" #define DONESTR "done" enum{ @@ -250,7 +249,7 @@ rio(Fcall *fin, Fcall *fout) void usage(void) { - fprint(2, "usage: iostats [-dC] [-f debugfile] cmds [args ...]\n"); + fprint(2, "usage: iostats [-dC] cmds [args ...]\n"); exits("usage"); } @@ -259,7 +258,6 @@ main(int argc, char **argv) { Rpc *rpc; ulong ttime; - char *dbfile; char buf[64*1024]; float brpsec, bwpsec, bppsec; int cpid, fspid, expid, rspid, dbg, n, mflag; @@ -270,15 +268,11 @@ main(int argc, char **argv) dbg = 0; mflag = MREPL; - dbfile = DEBUGFILE; ARGBEGIN{ case 'd': dbg++; break; - case 'f': - dbfile = ARGF(); - break; case 'C': mflag |= MCACHE; break; @@ -286,8 +280,6 @@ main(int argc, char **argv) usage(); }ARGEND - USED(dbfile); - if(argc == 0) usage(); @@ -359,7 +351,7 @@ main(int argc, char **argv) close(efd[1]); close(pfd[1]); if(dbg){ - execl("/bin/exportfs", "exportfs", "-df", dbfile, "-r", "/", nil); + execl("/bin/exportfs", "exportfs", "-d", "-r", "/", nil); } else { execl("/bin/exportfs", "exportfs", "-r", "/", nil); } -- cgit v1.2.3