Skip to content

Fixes support for syslog when salt is running as non-root user#68890

Open
shadow38 wants to merge 2 commits intosaltstack:3006.xfrom
shadow38:syslog-support-3006
Open

Fixes support for syslog when salt is running as non-root user#68890
shadow38 wants to merge 2 commits intosaltstack:3006.xfrom
shadow38:syslog-support-3006

Conversation

@shadow38
Copy link
Copy Markdown

@shadow38 shadow38 commented Apr 3, 2026

What does this PR do?

Adds support for file:// scheme in syslog handler configuration.

What issues does this PR fix or reference?

Closes #68801 (previous PR targeting master, reopened for 3006.x as requested by @dwoz)

Previous Commits

Cherry-picked from previous PR #68801 and rebased onto 3006.x

@shadow38 shadow38 requested a review from a team as a code owner April 3, 2026 12:39
@welcome
Copy link
Copy Markdown

welcome bot commented Apr 3, 2026

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here's some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject.pdl@broadcom.com. We're glad you've joined our community and look forward to doing awesome things with you!

@dwoz
Copy link
Copy Markdown
Contributor

dwoz commented Apr 4, 2026

@shadow38 please open an issue. Add a changelog for it and make sure we have test coverage.


parsed_log_path = urlparse(path)

if parsed_log_path.scheme in ("tcp", "udp", "file"):
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.

Should unix:// also be supported?

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.

I see that this is probably based on the documentation at https://docs.saltproject.io/en/latest/ref/configuration/logging/index.html#std-conf_log-log_file which does not include unix://. It seems like unix should also be supported but probably out of scope of this if it doesn't just work by adding it here.

)

if not is_writeable(logfile, check_parent=True):
if not is_syslog_path(logfile) and not is_writeable(logfile, check_parent=True):
Copy link
Copy Markdown
Contributor

@bdrx312 bdrx312 Apr 8, 2026

Choose a reason for hiding this comment

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

The docstring of is_syslog_path says log-facility is optional but returns False if the prefix is tcp:///udp:// and the log-facility is not provided. In general I don't think we care that the file is specifically a "syslog" path. It seems like we should allow writing to any log specified with file://,tcp://,udp:// which would be more robust.

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.

According the last example in the documentation at https://docs.saltproject.io/en/latest/ref/configuration/logging/index.html#std-conf_log-log_file log_file: udp://loghost:10514 should also be supported and work.

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.

3 participants