Skip to content

Add --disable-syslog configure option#1618

Open
FreziDok wants to merge 1 commit intoshadow-maint:masterfrom
FreziDok:Add-disable-syslog-option
Open

Add --disable-syslog configure option#1618
FreziDok wants to merge 1 commit intoshadow-maint:masterfrom
FreziDok:Add-disable-syslog-option

Conversation

@FreziDok
Copy link
Copy Markdown

Implements --disable-syslog configuration option, as discussed in #1610

Addresses #1610

Comment thread lib/io/syslog.h Outdated
Comment thread configure.ac Outdated
Comment thread configure.ac
@FreziDok FreziDok force-pushed the Add-disable-syslog-option branch from be8177d to 7ce73d8 Compare April 28, 2026 13:14
Comment thread lib/io/syslog.h
    
It allows build systems like Yocto to disable syslog calls during native builds, preventing log spam on the build host.

Addresses shadow-maint#1610

Signed-off-by: Dmitry Sakhonchik <frezidok1@gmail.com>
@FreziDok FreziDok force-pushed the Add-disable-syslog-option branch from 7ce73d8 to a11d1aa Compare April 28, 2026 13:56
Comment thread configure.ac

AC_ARG_ENABLE([syslog],
[AS_HELP_STRING([--disable-syslog],
[disable syslog() calls @<:@default=no@:>@])],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One cause use --disable-syslog --enable-syslog as shorter versions
instead of using --enable-syslog=no

IMHO it is simpler to read "positive flags" in code and in help

WDYT about change?

-	[AS_HELP_STRING([--disable-syslog],
-		[disable syslog() calls @<:@default=no@:>@])],
+	[AS_HELP_STRING([--enable-syslog],
+		[enable syslog() calls @<:@default=yes@:>@])],

Copy link
Copy Markdown
Collaborator

@alejandro-colomar alejandro-colomar Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it is simpler to read "positive flags" in code and in help

Agree.

WDYT about change?

Sounds reasonable. However, I don't understand much about the build system. Maybe others have other opinions.

Cc: @thesamesam , @Karlson2k , @jubalh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually parameter indicated as '--disable-something' when 'something' is enabled by default.
And the opposite: help string is '--enable-something', when 'something' is disabled by default.
Here the default value is 'enabled', it means that logically help string should be '--disable-syslog' (as '--enable-syslog' is no-op in this case).

Copy link
Copy Markdown
Contributor

@Karlson2k Karlson2k Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words: seeing '--enable-syslog' in built-in help one may think that syslog is disabled by default and must be enabled explicitly.

Makes a little sense to document parameter '--enable-syslog' which changes nothing, while only '--disable-syslog' changes something and it is not documented explicitly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity: the help string is wrong. It must be

[AS_HELP_STRING([--disable-syslog],
		[disable syslog() calls])],

only --enable-something may have optional parameter, like --enable-something=no.
--disable-something is converted automatically to --enable-something=no, while --disable-something=no is reported by configure as an error.

Alternatively, you may use

[AS_HELP_STRING([--disable-syslog],
		[[disable syslog() calls [enable]]])],

or

[AS_HELP_STRING([--disable-syslog],
		[[disable syslog() calls [enabled by default]]])],

but I don't think that it will add any clarity.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only --enable-something may have optional parameter

It makes sense, thanks for the correction.

I think

[[disable syslog() calls [enable]]])],

and

[[disable syslog() calls [enabled by default]]])],

are only adding obscurity, because it's hard to understand what is enabled: disable function (means syslog is disabled) or syslog function, so I think your first variant with only [disable syslog() calls])], is the most appropriate.

Comment thread configure.ac
@@ -145,6 +145,13 @@ AC_ARG_ENABLE([logind],
[enable_logind="yes"]
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the commit message:

Addresses #1610

Please spell that as:

Closes: <https://github.com/shadow-maint/shadow/issues/1610>

Comment thread configure.ac
AC_ARG_ENABLE([syslog],
[AS_HELP_STRING([--disable-syslog],
[disable syslog() calls @<:@default=no@:>@])],
[enable_syslog="${enableval}"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless assignment.
It is expanded by autoconf to literallly:

enableval="$enable_syslog"

enable_syslog="${enableval}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be left empty or added value checking, like

AS_CASE([${enableval}],
  [yes|no],[:],
  [AC_MSG_ERROR([wrong parameter value: --enable-syslog=${enableval}])]
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not an expert in autoconf, so I just looked at others options like

AC_ARG_ENABLE([lastlog],
	[AS_HELP_STRING([--enable-lastlog],
		[enable lastlog @<:@default=no@:>@])],
	[enable_lastlog="${enableval}"],
	[enable_lastlog="no"]
)

and did the same as there.

Could you please explain what is the difference between them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants