Repository navigation
fix(plex): disable redundant rsyslog to prevent AppArmor sendmsg denials - #18022
SweetAndLow wants to merge 2 commits into
Conversation
…enials In unprivileged Ubuntu 24.04 LXC containers on modern Proxmox kernels, systemd-journald triggers AppArmor sendmsg denials on /run/systemd/journal/dev-log when forwarding messages to rsyslog. Placing this check early in plex-install.sh (immediately after network_check and before update_os) disables and masks rsyslog before apt begins unpacking packages. This eliminates host-level AppArmor audit denials during initial installation and ensures rsyslog remains permanently inactive on future boots. System logging continues natively via systemd-journald, and Plex logs directly to its own application log files.
Complements the install script fix for existing container deployments. When running update_script() inside an existing unprivileged Ubuntu 24.04 container, this check disables and masks rsyslog and syslog.socket to eliminate repeated AppArmor sendmsg denials on /run/systemd/journal/dev-log. The check is guarded by 'systemctl is-active --quiet rsyslog', making it idempotent and silent on systems where rsyslog is already disabled or masked. System logging continues natively via systemd-journald, and Plex logs directly to its own application log files.
Try this branchThe engine and the scripts resolve independently, so this runs the changed export COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/SweetAndLow/ProxmoxVE/main
bash -c "$(curl -fsSL "$COMMUNITY_SCRIPTS_URL/ct/plex.sh")"Both lines are needed. Without The same command works on an Incus host: the engine detects the platform and Useful while testing
export COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/SweetAndLow/ProxmoxVE/main
dev_mode=net,keep bash -c "$(curl -fsSL "$COMMUNITY_SCRIPTS_URL/ct/plex.sh")" |
|
@MickLesk Thanks for taking a look. I understand the perspective that this originates from Ubuntu's stock packaging, but I’d like to share why this specifically impacts this script and why upstream won't resolve it:
Because the decision to deploy unprivileged is made by the script, handling this cleanup directly in the install script ensures users get a clean, error-free deployment out of the box without noisy system log failures. Would you be open to reconsidering if we keep the fix minimal, or alternatively, considering a migration of the Plex script to a Debian base in the future? |
|
If upstream treats this as expected behavior for unprivileged containers and won't change it, that's not a reason for us to work around it. It means it's how the Ubuntu template behaves. We don't patch around distro or kernel behavior in individual install scripts. On consistency: when scripts clean up, it's at the application level (build leftovers, unused packages). This is about how the host kernel's AppArmor handles the guest's rsyslog profile. It's a different layer, and not something an installer should interfere with. The workaround is documented in #11998 for anyone who wants it. |
|
Switch to Debian a possibility? |
|
Official Plex force Ubuntu. You can switch by your own. But there are no support from us. |
✍️ Description
(Drafted with AI assistance using Gemini 3.8 Flash, Reasoning Level: High)
In unprivileged Ubuntu 24.04 LXC containers on modern Proxmox kernels (6.8+),
systemd-journaldrepeatedly triggers AppArmor audit denials when attempting to forward datagrams torsyslogover the/run/systemd/journal/dev-logsocket:Because unprivileged containers cannot reload host AppArmor profiles (
apparmor_parser), this cannot be resolved via local profile overrides from inside the container.Furthermore,
rsyslogis completely redundant in this container:systemd-journaldmanages all system logs natively (journalctl).Plex Media Server.log).Changes
install/plex-install.sh: Masksrsyslogand disablessyslog.socketimmediately after container initialization (beforeupdate_os), preventing AppArmor denials right from first boot and during theaptinstallation phase.ct/plex.sh: Adds an idempotent check (systemctl is-active --quiet rsyslog) inupdate_script()to cleanly disable and maskrsyslogon existing container deployments when updated.🔗 Related Issue
Fixes #
✅ Prerequisites (x in brackets)
Tested on: PVE 9.2 (Kernel 7.0.2-6-pve) / Ubuntu 24.04 LXC (Unprivileged) / fresh install + update verification
🤖 AI Assistance (X in brackets)
AGENTS.mdand.github/agents/pve-script-creator.agent.mdas guidance, and the output has been reviewed and corrected to match those guidelines.🛠️ Type of Change (X in brackets)
README,AppName.md,CONTRIBUTING.md, or other docs.💥 Breaking Change Advisory (only if you checked "Breaking change")