From c8f19df99cbc05d281bd1c399a6becfbf9244b36 Mon Sep 17 00:00:00 2001 From: Pi-Farm <43029891+pi-farm@users.noreply.github.com> Date: Mon, 8 Jun 2026 11:29:42 +0200 Subject: [PATCH] Create a shim for systemctl in container Implement a shim for systemctl to handle service actions in a container environment, with a critical fix to ignore 'samba-ad-dc' to prevent RPC conflicts. --- root/usr/local/bin/systemctl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 root/usr/local/bin/systemctl diff --git a/root/usr/local/bin/systemctl b/root/usr/local/bin/systemctl new file mode 100644 index 0000000..a9a3d27 --- /dev/null +++ b/root/usr/local/bin/systemctl @@ -0,0 +1,32 @@ +#!/bin/bash +# Gefälschtes systemctl für den Container + +ACTION=$1 +SERVICE=$2 + +# .service Endung entfernen, falls vorhanden +SERVICE=${SERVICE%.service} + +# CRITICAL FIX: samba-ad-dc komplett ignorieren, um den RPC-Konflikt zu verhindern! +if [[ "$SERVICE" == "samba-ad-dc" ]]; then + echo "Shim: Blocked samba-ad-dc to prevent RPC collision." + exit 0 +fi + +case "$ACTION" in + start|stop|restart|status) + if [ -x "/etc/init.d/$SERVICE" ]; then + /etc/init.d/$SERVICE "$ACTION" + else + service "$SERVICE" "$ACTION" 2>/dev/null || echo "Shim: Service $SERVICE not found" + fi + ;; + enable|disable|daemon-reload|unmask|mask) + # Diese Befehle sind im Container irrelevant, wir melden einfach Erfolg + exit 0 + ;; + *) + echo "Shim: Unknown command $ACTION for $SERVICE - ignoring." + exit 0 + ;; +esac