Compare commits

...

2 Commits

Author SHA1 Message Date
Pi-Farm
7e61613ad1 Add permissions and symlink for systemctl
Added executable permissions to systemctl and created a symlink.
2026-06-08 11:30:38 +02:00
Pi-Farm
808d83f9a5 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.
2026-06-08 11:29:42 +02:00
2 changed files with 33 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ ADD https://github.com/just-containers/s6-overlay/releases/download/v3.1.6.0/s6-
ADD https://github.com/just-containers/s6-overlay/releases/download/v3.1.6.0/s6-overlay-aarch64.tar.xz /tmp ADD https://github.com/just-containers/s6-overlay/releases/download/v3.1.6.0/s6-overlay-aarch64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-aarch64.tar.xz && tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && mkdir /app && mkdir /app/RPi-PXE-Server RUN tar -C / -Jxpf /tmp/s6-overlay-aarch64.tar.xz && tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && mkdir /app && mkdir /app/RPi-PXE-Server
COPY root/ / COPY root/ /
RUN chmod +x /usr/local/bin/systemctl && ln -sf /usr/local/bin/systemctl /usr/bin/systemctl
VOLUME /app/RPi-PXE-Server VOLUME /app/RPi-PXE-Server
VOLUME /srv VOLUME /srv
VOLUME /etc/samba VOLUME /etc/samba

View File

@@ -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