Fixes #472.
ctx.options &= ~DHCPCD_DAEMONISE;
#endif
- if (ctx.options & DHCPCD_DEBUG)
- logsetopts(logopts | LOGERR_DEBUG);
-
if (!(ctx.options & (DHCPCD_TEST | DHCPCD_DUMPLEASE))) {
printpidfile:
/* If we have any other args, we should run as a single dhcpcd
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
-.\" Copyright (c) 2006-2024 Roy Marples
+.\" Copyright (c) 2006-2025 Roy Marples
.\" All rights reserved
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd November 1, 2024
+.Dd February 23, 2025
.Dt DHCPCD.CONF 5
.Os
.Sh NAME
.It Ic nolink
Don't receive link messages about carrier status.
You should only set this for buggy interface drivers.
+.It Ic nosyslog
+Disable writing to syslog(3).
.It Ic noup
Don't bring the interface up when in manager mode.
.It Ic option Ar option
{"request_time", required_argument, NULL, O_REQUEST_TIME},
{"fallback_time", required_argument, NULL, O_FALLBACK_TIME},
{"ipv4ll_time", required_argument, NULL, O_IPV4LL_TIME},
+ {"nosyslog", no_argument, NULL, O_NOSYSLOG},
{NULL, 0, NULL, '\0'}
};
}
break;
case 'd':
- ifo->options |= DHCPCD_DEBUG;
+ logsetopts(loggetopts() | LOGERR_DEBUG);
break;
case 'e':
ARG_REQUIRED;
}
break;
#endif
+ case O_NOSYSLOG:
+ {
+ unsigned int logopts = loggetopts();
+
+ logopts &= ~LOGERR_LOG;
+ logsetopts(logopts);
+ }
+ break;
default:
return 0;
}
#define DHCPCD_RTBUILD (1ULL << 2)
#define DHCPCD_GATEWAY (1ULL << 3)
#define DHCPCD_STATIC (1ULL << 4)
-#define DHCPCD_DEBUG (1ULL << 5)
+//#define DHCPCD_DEBUG (1ULL << 5)
#define DHCPCD_ARP_PERSISTDEFENCE (1ULL << 6)
#define DHCPCD_LASTLEASE (1ULL << 7)
#define DHCPCD_INFORM (1ULL << 8)
#define O_IPV4LL_TIME O_BASE + 56
#define O_VSIO O_BASE + 57
#define O_VSIO6 O_BASE + 58
+#define O_NOSYSLOG O_BASE + 59
extern const struct option cf_options[];
ctx->log_opts = opts;
setlogmask(LOG_UPTO(opts & LOGERR_DEBUG ? LOG_DEBUG : LOG_INFO));
+ if (!(ctx->log_opts & LOGERR_LOG))
+ closelog();
}
#ifdef LOGERR_TAG
if (ctx->log_opts & LOGERR_LOG_PID)
opts |= LOG_PID;
- openlog(getprogname(), opts, LOGERR_SYSLOG_FACILITY);
+ if (ctx->log_opts & LOGERR_LOG)
+ openlog(getprogname(), opts, LOGERR_SYSLOG_FACILITY);
if (path == NULL)
return 1;
if (efprintf(fp, "af_waiting=%d", af) == -1)
goto eexit;
}
- if (ifo->options & DHCPCD_DEBUG) {
+ if (loggetopts() & LOGERR_DEBUG) {
if (efprintf(fp, "syslog_debug=true") == -1)
goto eexit;
}