Removed MNTTAB autodetection again as it seems to be already defined.

Don't skip rest of mountpoints if one is not accessible.
chdir to / while sleeping to avoid blocking automounters
increased default sleep interval to 1 hour max.
This commit is contained in:
hjp 2000-06-04 16:33:21 +00:00
parent b2865e2946
commit e0484a7006
2 changed files with 22 additions and 10 deletions

View File

@ -1,11 +1,11 @@
# $Id: GNUmakefile,v 1.2 2000-06-04 16:11:12 hjp Exp $ # $Id: GNUmakefile,v 1.3 2000-06-04 16:33:20 hjp Exp $
include GNUmakevars include GNUmakevars
ddm: ddm.o ddm: ddm.o
$(CC) $^ $(ANTLIB) -o $@ $(CC) $^ $(ANTLIB) -o $@
ddm.o: ddm.c cfg/mnttab.h ddm.o: ddm.c
clean: clean:
rm ddm ddm.o rm ddm ddm.o
@ -20,7 +20,13 @@ include GNUmakerules
-include ddm.d -include ddm.d
# $Log: GNUmakefile,v $ # $Log: GNUmakefile,v $
# Revision 1.2 2000-06-04 16:11:12 hjp # Revision 1.3 2000-06-04 16:33:20 hjp
# Removed MNTTAB autodetection again as it seems to be already defined.
# Don't skip rest of mountpoints if one is not accessible.
# chdir to / while sleeping to avoid blocking automounters
# increased default sleep interval to 1 hour max.
#
# Revision 1.2 2000/06/04 16:11:12 hjp
# Added autodetection of /etc/m(nt)?tab. # Added autodetection of /etc/m(nt)?tab.
# #
# Revision 1.1 2000/06/04 15:53:18 hjp # Revision 1.1 2000/06/04 15:53:18 hjp

View File

@ -1,5 +1,5 @@
char ddm_c_rcs_id[] = char ddm_c_rcs_id[] =
"$Id: ddm.c,v 1.3 2000-06-04 16:19:00 hjp Exp $"; "$Id: ddm.c,v 1.4 2000-06-04 16:33:21 hjp Exp $";
/* /*
* ddm - disk delay monitor * ddm - disk delay monitor
* *
@ -20,8 +20,6 @@ char ddm_c_rcs_id[] =
#include <ant/da.h> #include <ant/da.h>
#include "cfg/mnttab.h"
static double gettimestamp(void) { static double gettimestamp(void) {
struct timeval tm; struct timeval tm;
@ -75,7 +73,7 @@ int main(int argc, char**argv) {
if (chdir(dirs[i]) == -1) { if (chdir(dirs[i]) == -1) {
fprintf(stderr, "%s: %.6f: chdir %s failed: %s\n", fprintf(stderr, "%s: %.6f: chdir %s failed: %s\n",
argv[0], gettimestamp(), dirs[i], strerror(errno)); argv[0], gettimestamp(), dirs[i], strerror(errno));
break; continue;
} }
fprintf(stderr, "%s: %.6f: chdir %s ok\n", fprintf(stderr, "%s: %.6f: chdir %s ok\n",
argv[0], gettimestamp(), dirs[i]); argv[0], gettimestamp(), dirs[i]);
@ -83,7 +81,7 @@ int main(int argc, char**argv) {
if ((dp = opendir(".")) == NULL) { if ((dp = opendir(".")) == NULL) {
fprintf(stderr, "%s: %.6f: opendir %s failed: %s\n", fprintf(stderr, "%s: %.6f: opendir %s failed: %s\n",
argv[0], gettimestamp(), dirs[i], strerror(errno)); argv[0], gettimestamp(), dirs[i], strerror(errno));
break; continue;
} }
for (j = 0;(de = readdir(dp)); j++) { for (j = 0;(de = readdir(dp)); j++) {
DA_MKIND_INI(entries, j, NULL); DA_MKIND_INI(entries, j, NULL);
@ -103,7 +101,9 @@ int main(int argc, char**argv) {
} }
} }
sleeptime = rand() * 60.0 / RAND_MAX; chdir("/");
sleeptime = rand() * 3600.0 / RAND_MAX;
fprintf(stderr, "%s: %.6f: sleeping %d seconds\n", fprintf(stderr, "%s: %.6f: sleeping %d seconds\n",
argv[0], gettimestamp(), sleeptime); argv[0], gettimestamp(), sleeptime);
sleep(sleeptime); sleep(sleeptime);
@ -115,7 +115,13 @@ int main(int argc, char**argv) {
/* /*
* $Log: ddm.c,v $ * $Log: ddm.c,v $
* Revision 1.3 2000-06-04 16:19:00 hjp * Revision 1.4 2000-06-04 16:33:21 hjp
* Removed MNTTAB autodetection again as it seems to be already defined.
* Don't skip rest of mountpoints if one is not accessible.
* chdir to / while sleeping to avoid blocking automounters
* increased default sleep interval to 1 hour max.
*
* Revision 1.3 2000/06/04 16:19:00 hjp
* Fixed order of args in fprintf (segfault). * Fixed order of args in fprintf (segfault).
* *
* Revision 1.2 2000/06/04 16:11:12 hjp * Revision 1.2 2000/06/04 16:11:12 hjp