Commit f6eb42bc authored by Leigh B Stoller's avatar Leigh B Stoller

Move daemon() later till we actually have the socket created and

parent b519e821
* Copyright (c) 2000-2016 University of Utah and the Flux Group.
* Copyright (c) 2000-2016, 2019 University of Utah and the Flux Group.
......@@ -112,9 +112,6 @@ main(int argc, char **argv)
openlog("capserver", LOG_PID, LOG_TESTBED);
syslog(LOG_NOTICE, "daemon starting");
if (!debug)
(void)daemon(0, 0);
if (!dbinit()) {
syslog(LOG_ERR, "Could not connect to DB!");
......@@ -227,6 +224,9 @@ main(int argc, char **argv)
syslog(LOG_NOTICE, "listening on TCP port %d", ntohs(name.sin_port));
if (!debug)
(void)daemon(0, 0);
if (!getuid()) {
FILE *fp;
char mybuf[BUFSIZ];
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