From a9a8b66de89316e8ef2d8d068f0deb37e781ae69 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Tue, 20 Sep 2016 16:45:10 +0000 Subject: Unbreak logging for children process in switchd(8). log_init/verbose() must be called before proc_init() otherwise child process won't have this configured. ok reyk@ --- usr.sbin/switchd/switchd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/switchd/switchd.c b/usr.sbin/switchd/switchd.c index 45311dad0b4..1fbdcce24df 100644 --- a/usr.sbin/switchd/switchd.c +++ b/usr.sbin/switchd/switchd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: switchd.c,v 1.9 2016/09/15 15:52:22 rzalamena Exp $ */ +/* $OpenBSD: switchd.c,v 1.10 2016/09/20 16:45:09 rzalamena Exp $ */ /* * Copyright (c) 2013-2016 Reyk Floeter @@ -172,6 +172,9 @@ main(int argc, char *argv[]) if ((ps->ps_pw = getpwnam(SWITCHD_USER)) == NULL) fatalx("unknown user " SWITCHD_USER); + log_init(debug, LOG_DAEMON); + log_verbose(verbose); + /* Configure the control socket */ ps->ps_csock.cs_name = SWITCHD_SOCKET; ps->ps_instance = proc_instance; @@ -181,9 +184,6 @@ main(int argc, char *argv[]) /* Only the parent returns. */ proc_init(ps, procs, nitems(procs), argc0, argv, proc_id); - log_init(debug, LOG_DAEMON); - log_verbose(verbose); - if (!debug && daemon(0, 0) == -1) fatal("failed to daemonize"); -- cgit v1.2.3