From 799a7217610e487972091dd10fd8b062f889a06d Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Fri, 10 Apr 2026 00:10:53 -0700 Subject: [PATCH] Be more defensive about systemd detection --- pkg/aur/remoteterm-meshcore.install | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/aur/remoteterm-meshcore.install b/pkg/aur/remoteterm-meshcore.install index 256972e..7161a0b 100644 --- a/pkg/aur/remoteterm-meshcore.install +++ b/pkg/aur/remoteterm-meshcore.install @@ -20,10 +20,12 @@ post_upgrade() { # Clean orphaned __pycache__ dirs left by the previous Python version find /opt/remoteterm-meshcore -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true - if command -v systemctl &>/dev/null && systemctl --version &>/dev/null 2>&1; then - systemctl daemon-reload + # Skip systemd operations in chroots/containers where the binary may exist + # but PID 1 is not systemd. + if [ -d /run/systemd/system ] && command -v systemctl &>/dev/null; then + systemctl daemon-reload || true if systemctl is-active --quiet remoteterm-meshcore; then - systemctl restart remoteterm-meshcore + systemctl restart remoteterm-meshcore || true fi fi }