summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-01-22 12:00:10 +0000
committerRoy Marples <roy@marples.name>2020-01-22 12:00:10 +0000
commit730ce26da503f523748c7910558fc769131779ac (patch)
treef3120fdc353d45f5dbfa9d04805b46500ec386d4 /src/dhcpcd.c
parenteed9c74e6c37ed1ddb549e9894fb21aee5704209 (diff)
downloaddhcpcd-730ce26da503f523748c7910558fc769131779ac.tar.xz
logging: Always log to syslog(3).
--logfile may not work that well in a chroot on receipt of SIGUSR2 because the path is of course different. Might have to drop this option soon as I have no good ideas on how to resolve it :(
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index f0456ce6..df2aff95 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -345,7 +345,8 @@ dhcpcd_daemonise(struct dhcpcd_ctx *ctx)
!(ctx->options & DHCPCD_DAEMONISE))
return;
- loginfox("forked to background, child pid %d", getpid());
+ /* Don't use loginfo because this makes no sense in a log. */
+ fprintf(stderr, "forked to background, child pid %d\n", getpid());
i = EXIT_SUCCESS;
if (write(ctx->fork_fd, &i, sizeof(i)) == -1)
logerr("write");
@@ -1371,6 +1372,7 @@ dhcpcd_signal_cb(int sig, void *arg)
return;
case SIGUSR2:
loginfox(sigmsg, "SIGUSR2", "reopening log");
+ /* XXX This may not work that well in a chroot */
logclose();
if (logopen(ctx->logfile) == -1)
logerr(__func__);