[PATCH] syslogd: fix locallog when remote log feature is active
Csókás Bence
csokas.bence at prolan.hu
Fri Mar 7 13:03:21 UTC 2025
Hi,
On 2025. 03. 05. 17:42, Nicholas Niro wrote:
> When the remote log feature is active, running syslogd would not log
> locally by default. Without this patch, the only way to activate local
> logging was to use the '-L' argument.
>
> tested by doing :
>
> busybox syslogd -n -f /dev/null -O -
>
> And then by running :
>
> busybox logger foo bar
>
> The syslogd process is expected to output a message like :
>
> <date> user.notice <youruser> foo bar
>
> Signed-off-by: Nicholas Niro <blowfist at xroutine.net>
> ---
> sysklogd/syslogd.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
> index 7558051f0..075d08f99 100644
> --- a/sysklogd/syslogd.c
> +++ b/sysklogd/syslogd.c
> @@ -1044,8 +1044,10 @@ static int NOINLINE syslogd_init(char **argv)
> G.shm_size = xatoul_range(opt_C, 4, INT_MAX/1024) * 1024;
> #endif
> /* If they have not specified remote logging, then log locally */
> - if (ENABLE_FEATURE_REMOTE_LOG && !(opts & OPT_remotelog)) // -R
> + if (ENABLE_FEATURE_REMOTE_LOG && !(opts & OPT_remotelog)) { // -R
> option_mask32 |= OPT_locallog;
> + opts |= OPT_locallog;
> + }
> #if ENABLE_FEATURE_SYSLOGD_CFG
> parse_syslogdcfg(opt_f);
> #endif
It turns out, this problem has been brought up in Oct 2024 and Sep 2023:
https://lists.busybox.net/pipermail/busybox/2024-October/090969.html
Why hasn't this been merged yet??? People will re-implement this again
and again and again and again...
Bence
More information about the busybox
mailing list