Skip to content

fix: create boot logs directory before syslog writes#2655

Open
ljm42 wants to merge 1 commit into
masterfrom
fix/boot-syslog-logs-directory
Open

fix: create boot logs directory before syslog writes#2655
ljm42 wants to merge 1 commit into
masterfrom
fix/boot-syslog-logs-directory

Conversation

@ljm42
Copy link
Copy Markdown
Member

@ljm42 ljm42 commented May 28, 2026

Summary

  • create /boot/logs before rc.6 copies syslog to the boot device during shutdown
  • create /boot/logs before enabling rsyslog mirror-to-flash output

Why

Shutdown could emit cp: cannot create regular file '/boot/logs/syslog': No such file or directory when the boot logs directory did not already exist.

Validation

  • bash -n etc/rc.d/rc.6
  • bash -n emhttp/plugins/dynamix/scripts/rsyslog_config

Summary by CodeRabbit

Bug Fixes

  • Enhanced system log handling by automatically creating required directories for boot logs during startup and shutdown procedures, preventing potential write failures.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7794f536-1629-4c36-b9c7-6a0ef9e7dfe1

📥 Commits

Reviewing files that changed from the base of the PR and between 982b3c2 and d8300f0.

📒 Files selected for processing (2)
  • emhttp/plugins/dynamix/scripts/rsyslog_config
  • etc/rc.d/rc.6

Walkthrough

This PR adds directory creation checks in two shell scripts to ensure /boot/logs exists before attempting to write logs to it. The rsyslog configuration script creates the directory when flash logging is configured, and the shutdown script creates it before copying the system log during reboot.

Changes

Boot logs directory initialization

Layer / File(s) Summary
Ensure /boot/logs directory exists at configuration and shutdown
emhttp/plugins/dynamix/scripts/rsyslog_config, etc/rc.d/rc.6
When syslog_flash is enabled, the configuration script creates /boot/logs before setting up flash rsyslog rules. During shutdown, the reboot script creates /boot/logs before copying /var/log/syslog to it.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🐰 Two directories, one simple task,
Flash logs need a home to last,
mkdir makes sure paths exist—
Before the files persist.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely summarizes the main changes: creating the /boot/logs directory before syslog writes, which directly addresses the issue of shutdown errors when the directory doesn't exist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/boot-syslog-logs-directory

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.05.28.1531
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2655/webgui-pr-2655.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix/scripts/rsyslog_config
etc/rc.d/rc.6

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2655, or run:

plugin remove webgui-pr-2655

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

@ljm42 ljm42 marked this pull request as ready for review May 28, 2026 16:19
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.

1 participant