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 }