tap-vsockd: use stderr rather than syslog if service guid is wrong

Our convention is to print command-line parse failures to the terminal
to allow easier interactive debugging, rather than sending them to
the syslog.

Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
David Scott 2016-05-21 14:10:16 +01:00
parent 1805c803a9
commit 1e96379e3f

View File

@ -387,19 +387,19 @@ int main(int argc, char **argv)
fprintf(stderr, "For daemon mode, please supply a --pidfile argument.\n");
exit(1);
}
res = parseguid(serviceid, &sid);
if (res) {
fprintf(stderr, "Failed to parse serviceid as GUID: %s\n", serviceid);
usage(argv[0]);
exit(1);
}
int log_flags = LOG_CONS | LOG_NDELAY;
if (!daemon_flag) {
log_flags |= LOG_PERROR;
}
openlog(argv[0], log_flags, LOG_DAEMON);
res = parseguid(serviceid, &sid);
if (res) {
syslog(LOG_CRIT, "Failed to parse serviceid as GUID: %s", serviceid);
usage(argv[0]);
exit(1);
}
int sock = -1;
if (listen_flag) {
syslog(LOG_INFO, "starting in listening mode with serviceid=%s and tap=%s", serviceid, tap);