Skip to content

[code sync] Merge code from sonic-net/sonic-buildimage:202511 to 202512#2175

Merged
mssonicbld merged 3 commits intoAzure:202512from
mssonicbld:sonicbld/202512-merge
Apr 14, 2026
Merged

[code sync] Merge code from sonic-net/sonic-buildimage:202511 to 202512#2175
mssonicbld merged 3 commits intoAzure:202512from
mssonicbld:sonicbld/202512-merge

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

* 66766f564 - (head/202511) [rsyslog] Fix Trixie restart delay with conditional restart (#26576) (2026-04-14) [mssonicbld]
* 8b612d25d - Revert "[platform/broadcom]: Remove static warmboot mount from docker-syncd-b…" (#26730) (2026-04-13) [Liping Xu]<br>```

lipxu and others added 3 commits April 13, 2026 09:23
…-syncd-b…" (#26730)

This reverts commit 379a7a6.

Signed-off-by: Liping Xu <108326363+lipxu@users.noreply.github.com>
#### Why I did it
On Debian 13 (Trixie), `rsyslog.service` includes systemd sandboxing directives (`PrivateTmp`, `ProtectSystem`, `ProtectKernelTunables`, etc.) that add ~4 seconds of overhead per restart due to namespace setup/teardown. This causes syslog-dependent tests to fail by missing log messages during the extended restart window.

Fixes #25382

#### How I did it
Instead of always restarting rsyslog after generating the config, we now:

1. Generate the config to a unique temp file (`mktemp`)
2. Compare with the existing `/etc/rsyslog.conf` using `cmp -s`
3. **Config changed** (or first boot): install the new config and restart rsyslog
4. **Config unchanged**: send `SIGHUP` to rsyslog to re-open log files without a full restart

The `SIGHUP` fallback is critical — it ensures rsyslog re-opens its file handles even when the config has not changed (needed after log rotation or `/var/log` remounts), while completely avoiding the 4-second namespace teardown/setup cycle. This preserves the upstream Trixie sandboxing directives.

Additional hardening:
- `mktemp` for unique temp files with `trap`-based cleanup on exit
- Explicit first-boot handling (missing `/etc/rsyslog.conf`)
- Error handling on `cp` failure (do not restart with stale config)

#### How to verify it
1. Build a VS image with this change
2. Boot and verify rsyslog is running: `systemctl status rsyslog`
3. Run `config reload` — rsyslog should NOT restart (config unchanged), only SIGHUP:
 ```
 journalctl -u rsyslog --since "1 min ago"
 # Should show rsyslog re-opening files, NOT a stop/start cycle
 ```
4. Change a syslog config (e.g., add a remote server), run `config reload` — rsyslog should do a full restart
5. Run `syslog/test_logrotate.py` — both test cases should pass (SIGHUP re-opens files after /var/log remount)

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@mssonicbld mssonicbld merged commit fe6f0f6 into Azure:202512 Apr 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants