[PATCH] syslogd: fix locallog when remote log feature is active

Csókás Bence csokas.bence at prolan.hu
Wed Mar 5 12:12:29 UTC 2025


Hi,

On 2025. 03. 04. 21:17, 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 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
> index 7558051f0..2ff994b08 100644
> --- a/sysklogd/syslogd.c
> +++ b/sysklogd/syslogd.c
> @@ -1045,7 +1045,7 @@ static int NOINLINE syslogd_init(char **argv)
>   #endif
>   	/* If they have not specified remote logging, then log locally */
>   	if (ENABLE_FEATURE_REMOTE_LOG && !(opts & OPT_remotelog)) // -R
> -		option_mask32 |= OPT_locallog;

This would then break `timestamp_and_log_internal()`, which checks for 
this then.

> +		opts |= OPT_locallog;
>   #if ENABLE_FEATURE_SYSLOGD_CFG
>   	parse_syslogdcfg(opt_f);
>   #endif

Bence



More information about the busybox mailing list