Commit 5d9afb7a authored by Leigh Stoller's avatar Leigh Stoller

Minor interface changes to loginit.

parent 7fc2f10a
......@@ -57,7 +57,7 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
loginit("sample", 0);
loginit(0, 0);
/*
* Get our IP address. Thats how we name ourselves to the
......
......@@ -48,13 +48,16 @@ main(int argc, char **argv)
event_handle_t handle;
char *server = NULL;
char *port = NULL;
char *log = NULL;
char buf[BUFSIZ];
int c, count;
progname = argv[0];
/* Initialize event queue semaphores: */
sched_event_init();
while ((c = getopt(argc, argv, "s:p:d")) != -1) {
while ((c = getopt(argc, argv, "s:p:dl:")) != -1) {
switch (c) {
case 'd':
debug = 1;
......@@ -65,6 +68,9 @@ main(int argc, char **argv)
case 'p':
port = optarg;
break;
case 'l':
log = optarg;
break;
default:
fprintf(stderr, "Usage: %s [-s SERVER]\n", argv[0]);
return 1;
......@@ -78,7 +84,10 @@ main(int argc, char **argv)
pid = argv[0];
eid = argv[1];
loginit("event-sched", !debug);
if (debug)
loginit(0, log);
else
loginit(1, "event-sched");
/*
* Set up DB state.
......@@ -126,6 +135,8 @@ main(int argc, char **argv)
fatal("could not subscribe to EVENT_SCHEDULE event");
}
daemon(1, 1);
/*
* Hacky. Need to wait until all nodes in the experiment are
* in the ISUP state before we can start the event list rolling.
......
......@@ -62,7 +62,8 @@ main(int argc, char **argv)
if (argc != 1)
usage();
loginit("tbmevc", 0);
loginit(0, 0);
/*
* Uppercase event tags for now. Should be wired in list instead.
......
......@@ -61,7 +61,11 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
loginit("tbmevd", !debug);
if (debug)
loginit(0, 0);
else
loginit(1, "tbmevd");
/*
* Set up DB state.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment