Code Monkey home page Code Monkey logo

Comments (16)

williamdes avatar williamdes commented on September 2, 2024 2

I can confirm having the errors, here is my Dockerfile (it's a mess and WIP, but you just need to install systemd to have the files.
So I used dpkg -L systemd | grep ".service$" | tr '\n' '\0' | xargs -0 -n1 -i rm -v {} to remove them

FROM debian:bullseye

ADD --chmod=444 https://repository.rudder.io/apt/rudder_apt_key.gpg /etc/apt/trusted.gpg.d/rudder_apt_key.gpg

# See: https://github.com/Normation/rudder-packages
RUN echo "deb [signed-by=/etc/apt/trusted.gpg.d/rudder_apt_key.gpg] http://repository.rudder.io/apt/7.2/ bullseye main" > /etc/apt/sources.list.d/rudder.list && \
    apt-get update && \
    apt-get install systemd apache2 rsync gpg python3 -y && \
    # Remove systemd installed services new systemctl does not like them
    dpkg -L systemd | grep ".service$" | tr '\n' '\0' | xargs -0 -n1 -i rm -v {} && \
    apt-get install rudder-external-db -y && \
    apt-get install --download-only rudder-server rudder-relay -y

ADD --chmod=555 https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/v1.5.7106/files/docker/systemctl3.py /bin/systemctl

# See: https://askubuntu.com/a/482936/432270
RUN set -ex; \
    dpkg --unpack /var/cache/apt/archives/rudder-server_*.deb && \
    dpkg --unpack /var/cache/apt/archives/rudder-relay_*.deb && \
    # See: https://github.com/Normation/rudder-packages/pull/2711
    sed -i "s|propertie$|properties|" /opt/rudder/share/package-scripts/rudder-server-postinst && \
    sed -i "s|^systemctl start|#systemctl start|" /opt/rudder/share/package-scripts/rudder-relay-postinst && \
    sed -i "s|^chgrp|#chgrp|" /opt/rudder/bin/rudder-fix-repository-permissions && \
    apt-get install -fy && \
    apt-get clean && \
    rm -rv /var/cache/apt/archives /var/lib/apt/lists/* && \
    rm -rv /var/log/apt/* /var/log/dpkg.log /var/log/alternatives.log

VOLUME ['/opt/rudder/etc/rudder-pkg/rudder-pkg.conf']
CMD /bin/systemctl

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 2, 2024 1

@williamdes - I did use your code but I did need to replace the lines saying "ADD --chmod=444 https" as standard "docker" does not understand those commands. See the code I posted.

from docker-systemctl-replacement.

MekayelAnik avatar MekayelAnik commented on September 2, 2024 1

I can confirm having the errors, here is my Dockerfile (it's a mess and WIP, but you just need to install systemd to have the files. So I used dpkg -L systemd | grep ".service$" | tr '\n' '\0' | xargs -0 -n1 -i rm -v {} to remove them

FROM debian:bullseye

ADD --chmod=444 https://repository.rudder.io/apt/rudder_apt_key.gpg /etc/apt/trusted.gpg.d/rudder_apt_key.gpg

# See: https://github.com/Normation/rudder-packages
RUN echo "deb [signed-by=/etc/apt/trusted.gpg.d/rudder_apt_key.gpg] http://repository.rudder.io/apt/7.2/ bullseye main" > /etc/apt/sources.list.d/rudder.list && \
    apt-get update && \
    apt-get install systemd apache2 rsync gpg python3 -y && \
    # Remove systemd installed services new systemctl does not like them
    dpkg -L systemd | grep ".service$" | tr '\n' '\0' | xargs -0 -n1 -i rm -v {} && \
    apt-get install rudder-external-db -y && \
    apt-get install --download-only rudder-server rudder-relay -y

ADD --chmod=555 https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/v1.5.7106/files/docker/systemctl3.py /bin/systemctl

# See: https://askubuntu.com/a/482936/432270
RUN set -ex; \
    dpkg --unpack /var/cache/apt/archives/rudder-server_*.deb && \
    dpkg --unpack /var/cache/apt/archives/rudder-relay_*.deb && \
    # See: https://github.com/Normation/rudder-packages/pull/2711
    sed -i "s|propertie$|properties|" /opt/rudder/share/package-scripts/rudder-server-postinst && \
    sed -i "s|^systemctl start|#systemctl start|" /opt/rudder/share/package-scripts/rudder-relay-postinst && \
    sed -i "s|^chgrp|#chgrp|" /opt/rudder/bin/rudder-fix-repository-permissions && \
    apt-get install -fy && \
    apt-get clean && \
    rm -rv /var/cache/apt/archives /var/lib/apt/lists/* && \
    rm -rv /var/log/apt/* /var/log/dpkg.log /var/log/alternatives.log

VOLUME ['/opt/rudder/etc/rudder-pkg/rudder-pkg.conf']
CMD /bin/systemctl

this helped. Thanks

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 2, 2024 1

Actually, the only problems may come from services which are enabled.
There is a blacklist in the source code for some known parts - check "igno_always" having "systemd-*"

Now let's see what's left

# dpkg -L systemd | grep \\.service | grep wants | grep -v systemd-
/lib/systemd/system/getty.target.wants/getty-static.service
/lib/systemd/system/sysinit.target.wants/kmod-static-nodes.service

The only thing that stands out is "kmod". I am adding that to the igno-list.

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 2, 2024

I can not reproduced it.

docker pull debian:bookworm-slim
docker run -d --name bookworm-slim --rm=true debian:bookworm-slim sleep 9999
docker cp files/docker/systemctl3.py bookworm-slim:/usr/bin/
docker exec -it bookworm-slim bash

apt-get update
apt-get install -y python3
systemctl3.py daemon-reload

apt-get install -y psmisc
apt-get install -y nginx
systemctl3.py start nginx

pstree -a
sleep 9999
-nginx |-nginx |-nginx |-nginx |-nginx |-nginx |-nginx |-nginx -nginx

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 2, 2024

wget -O systemctX.py https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py

diff -u systemctX.py files/docker/systemctl3.py
--- systemctX.py 2023-03-17 05:14:20.337462545 +0100
+++ files/docker/systemctl3.py 2023-03-15 08:11:32.833556461 +0100
@@ -22,7 +22,7 @@
from types import GeneratorType

copyright = "(C) 2016-2023 Guido U. Draheim, licensed under the EUPL"
-version = "1.5.7106"
+version = "1.5.7113"

Even the file seems to be the same.

from docker-systemctl-replacement.

MekayelAnik avatar MekayelAnik commented on September 2, 2024

I have fresh OS (dietpi) installed in my Raspberry Pi4B and ran the exact command as you have:

docker pull debian:bookworm-slim docker run -d --name bookworm-slim --rm=true debian:bookworm-slim sleep 9999 docker cp systemctl3.py bookworm-slim:/usr/bin/ docker exec -it bookworm-slim bash apt-get update apt-get install -y python3 systemctl3.py daemon-reload

OUTPUT:
Get:1 http://deb.debian.org/debian bookworm InRelease [178 kB] Get:2 http://deb.debian.org/debian bookworm-updates InRelease [49.6 kB] Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB] Get:4 http://deb.debian.org/debian bookworm/main arm64 Packages [8891 kB] Get:5 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages [896 B] Fetched 9168 kB in 10s (906 kB/s) Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: ca-certificates krb5-locales libexpat1 libgpm2 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libncursesw6 libnsl2 libpython3-stdlib libpython3.11-minimal libpython3.11-stdlib libreadline8 libsqlite3-0 libssl3 libtirpc-common libtirpc3 media-types openssl python3-minimal python3.11 python3.11-minimal readline-common Suggested packages: gpm krb5-doc krb5-user python3-doc python3-tk python3-venv python3.11-venv python3.11-doc binutils binfmt-support readline-doc The following NEW packages will be installed: ca-certificates krb5-locales libexpat1 libgpm2 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libncursesw6 libnsl2 libpython3-stdlib libpython3.11-minimal libpython3.11-stdlib libreadline8 libsqlite3-0 libssl3 libtirpc-common libtirpc3 media-types openssl python3 python3-minimal python3.11 python3.11-minimal readline-common 0 upgraded, 26 newly installed, 0 to remove and 7 not upgraded. Need to get 10.4 MB of archives. After this operation, 38.3 MB of additional disk space will be used. Get:1 http://deb.debian.org/debian bookworm/main arm64 libssl3 arm64 3.0.8-1 [1801 kB] Get:2 http://deb.debian.org/debian bookworm/main arm64 libpython3.11-minimal arm64 3.11.2-4 [806 kB] Get:3 http://deb.debian.org/debian bookworm/main arm64 libexpat1 arm64 2.5.0-1 [84.8 kB] Get:4 http://deb.debian.org/debian bookworm/main arm64 python3.11-minimal arm64 3.11.2-4 [1857 kB] Get:5 http://deb.debian.org/debian bookworm/main arm64 python3-minimal arm64 3.11.2-1 [26.0 kB] Get:6 http://deb.debian.org/debian bookworm/main arm64 media-types all 10.0.0 [26.1 kB] Get:7 http://deb.debian.org/debian bookworm/main arm64 libncursesw6 arm64 6.4-2 [122 kB] Get:8 http://deb.debian.org/debian bookworm/main arm64 libkrb5support0 arm64 1.20.1-1 [31.5 kB] Get:9 http://deb.debian.org/debian bookworm/main arm64 libk5crypto3 arm64 1.20.1-1 [78.9 kB] Get:10 http://deb.debian.org/debian bookworm/main arm64 libkeyutils1 arm64 1.6.3-2 [8844 B] Get:11 http://deb.debian.org/debian bookworm/main arm64 libkrb5-3 arm64 1.20.1-1 [313 kB] Get:12 http://deb.debian.org/debian bookworm/main arm64 libgssapi-krb5-2 arm64 1.20.1-1 [123 kB] Get:13 http://deb.debian.org/debian bookworm/main arm64 libtirpc-common all 1.3.3+ds-1 [14.0 kB] Get:14 http://deb.debian.org/debian bookworm/main arm64 libtirpc3 arm64 1.3.3+ds-1 [80.9 kB] Get:15 http://deb.debian.org/debian bookworm/main arm64 libnsl2 arm64 1.3.0-2 [36.9 kB] Get:16 http://deb.debian.org/debian bookworm/main arm64 readline-common all 8.2-1.3 [69.0 kB] Get:17 http://deb.debian.org/debian bookworm/main arm64 libreadline8 arm64 8.2-1.3 [155 kB] Get:18 http://deb.debian.org/debian bookworm/main arm64 libsqlite3-0 arm64 3.40.1-1 [783 kB] Get:19 http://deb.debian.org/debian bookworm/main arm64 libpython3.11-stdlib arm64 3.11.2-4 [1744 kB] Get:20 http://deb.debian.org/debian bookworm/main arm64 python3.11 arm64 3.11.2-4 [572 kB] Get:21 http://deb.debian.org/debian bookworm/main arm64 libpython3-stdlib arm64 3.11.2-1 [9012 B] Get:22 http://deb.debian.org/debian bookworm/main arm64 python3 arm64 3.11.2-1 [26.0 kB] Get:23 http://deb.debian.org/debian bookworm/main arm64 openssl arm64 3.0.8-1 [1373 kB] Get:24 http://deb.debian.org/debian bookworm/main arm64 ca-certificates all 20230311 [153 kB] Get:25 http://deb.debian.org/debian bookworm/main arm64 krb5-locales all 1.20.1-1 [62.4 kB] Get:26 http://deb.debian.org/debian bookworm/main arm64 libgpm2 arm64 1.20.7-10+b1 [14.4 kB] Fetched 10.4 MB in 8s (1238 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libssl3:arm64. (Reading database ... 6003 files and directories currently installed.) Preparing to unpack .../libssl3_3.0.8-1_arm64.deb ... Unpacking libssl3:arm64 (3.0.8-1) ... Selecting previously unselected package libpython3.11-minimal:arm64. Preparing to unpack .../libpython3.11-minimal_3.11.2-4_arm64.deb ... Unpacking libpython3.11-minimal:arm64 (3.11.2-4) ... Selecting previously unselected package libexpat1:arm64. Preparing to unpack .../libexpat1_2.5.0-1_arm64.deb ... Unpacking libexpat1:arm64 (2.5.0-1) ... Selecting previously unselected package python3.11-minimal. Preparing to unpack .../python3.11-minimal_3.11.2-4_arm64.deb ... Unpacking python3.11-minimal (3.11.2-4) ... Setting up libssl3:arm64 (3.0.8-1) ... Setting up libpython3.11-minimal:arm64 (3.11.2-4) ... Setting up libexpat1:arm64 (2.5.0-1) ... Setting up python3.11-minimal (3.11.2-4) ... Selecting previously unselected package python3-minimal. (Reading database ... 6331 files and directories currently installed.) Preparing to unpack .../00-python3-minimal_3.11.2-1_arm64.deb ... Unpacking python3-minimal (3.11.2-1) ... Selecting previously unselected package media-types. Preparing to unpack .../01-media-types_10.0.0_all.deb ... Unpacking media-types (10.0.0) ... Selecting previously unselected package libncursesw6:arm64. Preparing to unpack .../02-libncursesw6_6.4-2_arm64.deb ... Unpacking libncursesw6:arm64 (6.4-2) ... Selecting previously unselected package libkrb5support0:arm64. Preparing to unpack .../03-libkrb5support0_1.20.1-1_arm64.deb ... Unpacking libkrb5support0:arm64 (1.20.1-1) ... Selecting previously unselected package libk5crypto3:arm64. Preparing to unpack .../04-libk5crypto3_1.20.1-1_arm64.deb ... Unpacking libk5crypto3:arm64 (1.20.1-1) ... Selecting previously unselected package libkeyutils1:arm64. Preparing to unpack .../05-libkeyutils1_1.6.3-2_arm64.deb ... Unpacking libkeyutils1:arm64 (1.6.3-2) ... Selecting previously unselected package libkrb5-3:arm64. Preparing to unpack .../06-libkrb5-3_1.20.1-1_arm64.deb ... Unpacking libkrb5-3:arm64 (1.20.1-1) ... Selecting previously unselected package libgssapi-krb5-2:arm64. Preparing to unpack .../07-libgssapi-krb5-2_1.20.1-1_arm64.deb ... Unpacking libgssapi-krb5-2:arm64 (1.20.1-1) ... Selecting previously unselected package libtirpc-common. Preparing to unpack .../08-libtirpc-common_1.3.3+ds-1_all.deb ... Unpacking libtirpc-common (1.3.3+ds-1) ... Selecting previously unselected package libtirpc3:arm64. Preparing to unpack .../09-libtirpc3_1.3.3+ds-1_arm64.deb ... Unpacking libtirpc3:arm64 (1.3.3+ds-1) ... Selecting previously unselected package libnsl2:arm64. Preparing to unpack .../10-libnsl2_1.3.0-2_arm64.deb ... Unpacking libnsl2:arm64 (1.3.0-2) ... Selecting previously unselected package readline-common. Preparing to unpack .../11-readline-common_8.2-1.3_all.deb ... Unpacking readline-common (8.2-1.3) ... Selecting previously unselected package libreadline8:arm64. Preparing to unpack .../12-libreadline8_8.2-1.3_arm64.deb ... Unpacking libreadline8:arm64 (8.2-1.3) ... Selecting previously unselected package libsqlite3-0:arm64. Preparing to unpack .../13-libsqlite3-0_3.40.1-1_arm64.deb ... Unpacking libsqlite3-0:arm64 (3.40.1-1) ... Selecting previously unselected package libpython3.11-stdlib:arm64. Preparing to unpack .../14-libpython3.11-stdlib_3.11.2-4_arm64.deb ... Unpacking libpython3.11-stdlib:arm64 (3.11.2-4) ... Selecting previously unselected package python3.11. Preparing to unpack .../15-python3.11_3.11.2-4_arm64.deb ... Unpacking python3.11 (3.11.2-4) ... Selecting previously unselected package libpython3-stdlib:arm64. Preparing to unpack .../16-libpython3-stdlib_3.11.2-1_arm64.deb ... Unpacking libpython3-stdlib:arm64 (3.11.2-1) ... Setting up python3-minimal (3.11.2-1) ... Selecting previously unselected package python3. (Reading database ... 6837 files and directories currently installed.) Preparing to unpack .../python3_3.11.2-1_arm64.deb ... Unpacking python3 (3.11.2-1) ... Selecting previously unselected package openssl. Preparing to unpack .../openssl_3.0.8-1_arm64.deb ... Unpacking openssl (3.0.8-1) ... Selecting previously unselected package ca-certificates. Preparing to unpack .../ca-certificates_20230311_all.deb ... Unpacking ca-certificates (20230311) ... Selecting previously unselected package krb5-locales. Preparing to unpack .../krb5-locales_1.20.1-1_all.deb ... Unpacking krb5-locales (1.20.1-1) ... Selecting previously unselected package libgpm2:arm64. Preparing to unpack .../libgpm2_1.20.7-10+b1_arm64.deb ... Unpacking libgpm2:arm64 (1.20.7-10+b1) ... Setting up media-types (10.0.0) ... Setting up libkeyutils1:arm64 (1.6.3-2) ... Setting up libgpm2:arm64 (1.20.7-10+b1) ... Setting up libtirpc-common (1.3.3+ds-1) ... Setting up libsqlite3-0:arm64 (3.40.1-1) ... Setting up krb5-locales (1.20.1-1) ... Setting up libkrb5support0:arm64 (1.20.1-1) ... Setting up libncursesw6:arm64 (6.4-2) ... Setting up libk5crypto3:arm64 (1.20.1-1) ... Setting up libkrb5-3:arm64 (1.20.1-1) ... Setting up openssl (3.0.8-1) ... Setting up readline-common (8.2-1.3) ... Setting up libreadline8:arm64 (8.2-1.3) ... Setting up ca-certificates (20230311) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/aarch64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Updating certificates in /etc/ssl/certs... 140 added, 0 removed; done. Setting up libgssapi-krb5-2:arm64 (1.20.1-1) ... Setting up libtirpc3:arm64 (1.3.3+ds-1) ... Setting up libnsl2:arm64 (1.3.0-2) ... Setting up libpython3.11-stdlib:arm64 (3.11.2-4) ... Setting up libpython3-stdlib:arm64 (3.11.2-1) ... Setting up python3.11 (3.11.2-4) ... Setting up python3 (3.11.2-1) ... running python rtupdate hooks for python3.11... running python post-rtupdate hooks for python3.11... Processing triggers for libc-bin (2.36-8) ... Processing triggers for ca-certificates (20230311) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. bash: /usr/bin/systemctl3.py: Permission denied

apt-get install -y psmisc apt-get install -y nginx systemctl3.py start nginx

OUTPUT:

Get:1 http://deb.debian.org/debian bookworm InRelease [178 kB] Get:2 http://deb.debian.org/debian bookworm-updates InRelease [49.6 kB] Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB] Get:4 http://deb.debian.org/debian bookworm/main arm64 Packages [8891 kB] Get:5 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages [896 B] Fetched 9168 kB in 10s (906 kB/s) Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: ca-certificates krb5-locales libexpat1 libgpm2 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libncursesw6 libnsl2 libpython3-stdlib libpython3.11-minimal libpython3.11-stdlib libreadline8 libsqlite3-0 libssl3 libtirpc-common libtirpc3 media-types openssl python3-minimal python3.11 python3.11-minimal readline-common Suggested packages: gpm krb5-doc krb5-user python3-doc python3-tk python3-venv python3.11-venv python3.11-doc binutils binfmt-support readline-doc The following NEW packages will be installed: ca-certificates krb5-locales libexpat1 libgpm2 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libncursesw6 libnsl2 libpython3-stdlib libpython3.11-minimal libpython3.11-stdlib libreadline8 libsqlite3-0 libssl3 libtirpc-common libtirpc3 media-types openssl python3 python3-minimal python3.11 python3.11-minimal readline-common 0 upgraded, 26 newly installed, 0 to remove and 7 not upgraded. Need to get 10.4 MB of archives. After this operation, 38.3 MB of additional disk space will be used. Get:1 http://deb.debian.org/debian bookworm/main arm64 libssl3 arm64 3.0.8-1 [1801 kB] Get:2 http://deb.debian.org/debian bookworm/main arm64 libpython3.11-minimal arm64 3.11.2-4 [806 kB] Get:3 http://deb.debian.org/debian bookworm/main arm64 libexpat1 arm64 2.5.0-1 [84.8 kB] Get:4 http://deb.debian.org/debian bookworm/main arm64 python3.11-minimal arm64 3.11.2-4 [1857 kB] Get:5 http://deb.debian.org/debian bookworm/main arm64 python3-minimal arm64 3.11.2-1 [26.0 kB] Get:6 http://deb.debian.org/debian bookworm/main arm64 media-types all 10.0.0 [26.1 kB] Get:7 http://deb.debian.org/debian bookworm/main arm64 libncursesw6 arm64 6.4-2 [122 kB] Get:8 http://deb.debian.org/debian bookworm/main arm64 libkrb5support0 arm64 1.20.1-1 [31.5 kB] Get:9 http://deb.debian.org/debian bookworm/main arm64 libk5crypto3 arm64 1.20.1-1 [78.9 kB] Get:10 http://deb.debian.org/debian bookworm/main arm64 libkeyutils1 arm64 1.6.3-2 [8844 B] Get:11 http://deb.debian.org/debian bookworm/main arm64 libkrb5-3 arm64 1.20.1-1 [313 kB] Get:12 http://deb.debian.org/debian bookworm/main arm64 libgssapi-krb5-2 arm64 1.20.1-1 [123 kB] Get:13 http://deb.debian.org/debian bookworm/main arm64 libtirpc-common all 1.3.3+ds-1 [14.0 kB] Get:14 http://deb.debian.org/debian bookworm/main arm64 libtirpc3 arm64 1.3.3+ds-1 [80.9 kB] Get:15 http://deb.debian.org/debian bookworm/main arm64 libnsl2 arm64 1.3.0-2 [36.9 kB] Get:16 http://deb.debian.org/debian bookworm/main arm64 readline-common all 8.2-1.3 [69.0 kB] Get:17 http://deb.debian.org/debian bookworm/main arm64 libreadline8 arm64 8.2-1.3 [155 kB] Get:18 http://deb.debian.org/debian bookworm/main arm64 libsqlite3-0 arm64 3.40.1-1 [783 kB] Get:19 http://deb.debian.org/debian bookworm/main arm64 libpython3.11-stdlib arm64 3.11.2-4 [1744 kB] Get:20 http://deb.debian.org/debian bookworm/main arm64 python3.11 arm64 3.11.2-4 [572 kB] Get:21 http://deb.debian.org/debian bookworm/main arm64 libpython3-stdlib arm64 3.11.2-1 [9012 B] Get:22 http://deb.debian.org/debian bookworm/main arm64 python3 arm64 3.11.2-1 [26.0 kB] Get:23 http://deb.debian.org/debian bookworm/main arm64 openssl arm64 3.0.8-1 [1373 kB] Get:24 http://deb.debian.org/debian bookworm/main arm64 ca-certificates all 20230311 [153 kB] Get:25 http://deb.debian.org/debian bookworm/main arm64 krb5-locales all 1.20.1-1 [62.4 kB] Get:26 http://deb.debian.org/debian bookworm/main arm64 libgpm2 arm64 1.20.7-10+b1 [14.4 kB] Fetched 10.4 MB in 8s (1238 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libssl3:arm64. (Reading database ... 6003 files and directories currently installed.) Preparing to unpack .../libssl3_3.0.8-1_arm64.deb ... Unpacking libssl3:arm64 (3.0.8-1) ... Selecting previously unselected package libpython3.11-minimal:arm64. Preparing to unpack .../libpython3.11-minimal_3.11.2-4_arm64.deb ... Unpacking libpython3.11-minimal:arm64 (3.11.2-4) ... Selecting previously unselected package libexpat1:arm64. Preparing to unpack .../libexpat1_2.5.0-1_arm64.deb ... Unpacking libexpat1:arm64 (2.5.0-1) ... Selecting previously unselected package python3.11-minimal. Preparing to unpack .../python3.11-minimal_3.11.2-4_arm64.deb ... Unpacking python3.11-minimal (3.11.2-4) ... Setting up libssl3:arm64 (3.0.8-1) ... Setting up libpython3.11-minimal:arm64 (3.11.2-4) ... Setting up libexpat1:arm64 (2.5.0-1) ... Setting up python3.11-minimal (3.11.2-4) ... Selecting previously unselected package python3-minimal. (Reading database ... 6331 files and directories currently installed.) Preparing to unpack .../00-python3-minimal_3.11.2-1_arm64.deb ... Unpacking python3-minimal (3.11.2-1) ... Selecting previously unselected package media-types. Preparing to unpack .../01-media-types_10.0.0_all.deb ... Unpacking media-types (10.0.0) ... Selecting previously unselected package libncursesw6:arm64. Preparing to unpack .../02-libncursesw6_6.4-2_arm64.deb ... Unpacking libncursesw6:arm64 (6.4-2) ... Selecting previously unselected package libkrb5support0:arm64. Preparing to unpack .../03-libkrb5support0_1.20.1-1_arm64.deb ... Unpacking libkrb5support0:arm64 (1.20.1-1) ... Selecting previously unselected package libk5crypto3:arm64. Preparing to unpack .../04-libk5crypto3_1.20.1-1_arm64.deb ... Unpacking libk5crypto3:arm64 (1.20.1-1) ... Selecting previously unselected package libkeyutils1:arm64. Preparing to unpack .../05-libkeyutils1_1.6.3-2_arm64.deb ... Unpacking libkeyutils1:arm64 (1.6.3-2) ... Selecting previously unselected package libkrb5-3:arm64. Preparing to unpack .../06-libkrb5-3_1.20.1-1_arm64.deb ... Unpacking libkrb5-3:arm64 (1.20.1-1) ... Selecting previously unselected package libgssapi-krb5-2:arm64. Preparing to unpack .../07-libgssapi-krb5-2_1.20.1-1_arm64.deb ... Unpacking libgssapi-krb5-2:arm64 (1.20.1-1) ... Selecting previously unselected package libtirpc-common. Preparing to unpack .../08-libtirpc-common_1.3.3+ds-1_all.deb ... Unpacking libtirpc-common (1.3.3+ds-1) ... Selecting previously unselected package libtirpc3:arm64. Preparing to unpack .../09-libtirpc3_1.3.3+ds-1_arm64.deb ... Unpacking libtirpc3:arm64 (1.3.3+ds-1) ... Selecting previously unselected package libnsl2:arm64. Preparing to unpack .../10-libnsl2_1.3.0-2_arm64.deb ... Unpacking libnsl2:arm64 (1.3.0-2) ... Selecting previously unselected package readline-common. Preparing to unpack .../11-readline-common_8.2-1.3_all.deb ... Unpacking readline-common (8.2-1.3) ... Selecting previously unselected package libreadline8:arm64. Preparing to unpack .../12-libreadline8_8.2-1.3_arm64.deb ... Unpacking libreadline8:arm64 (8.2-1.3) ... Selecting previously unselected package libsqlite3-0:arm64. Preparing to unpack .../13-libsqlite3-0_3.40.1-1_arm64.deb ... Unpacking libsqlite3-0:arm64 (3.40.1-1) ... Selecting previously unselected package libpython3.11-stdlib:arm64. Preparing to unpack .../14-libpython3.11-stdlib_3.11.2-4_arm64.deb ... Unpacking libpython3.11-stdlib:arm64 (3.11.2-4) ... Selecting previously unselected package python3.11. Preparing to unpack .../15-python3.11_3.11.2-4_arm64.deb ... Unpacking python3.11 (3.11.2-4) ... Selecting previously unselected package libpython3-stdlib:arm64. Preparing to unpack .../16-libpython3-stdlib_3.11.2-1_arm64.deb ... Unpacking libpython3-stdlib:arm64 (3.11.2-1) ... Setting up python3-minimal (3.11.2-1) ... Selecting previously unselected package python3. (Reading database ... 6837 files and directories currently installed.) Preparing to unpack .../python3_3.11.2-1_arm64.deb ... Unpacking python3 (3.11.2-1) ... Selecting previously unselected package openssl. Preparing to unpack .../openssl_3.0.8-1_arm64.deb ... Unpacking openssl (3.0.8-1) ... Selecting previously unselected package ca-certificates. Preparing to unpack .../ca-certificates_20230311_all.deb ... Unpacking ca-certificates (20230311) ... Selecting previously unselected package krb5-locales. Preparing to unpack .../krb5-locales_1.20.1-1_all.deb ... Unpacking krb5-locales (1.20.1-1) ... Selecting previously unselected package libgpm2:arm64. Preparing to unpack .../libgpm2_1.20.7-10+b1_arm64.deb ... Unpacking libgpm2:arm64 (1.20.7-10+b1) ... Setting up media-types (10.0.0) ... Setting up libkeyutils1:arm64 (1.6.3-2) ... Setting up libgpm2:arm64 (1.20.7-10+b1) ... Setting up libtirpc-common (1.3.3+ds-1) ... Setting up libsqlite3-0:arm64 (3.40.1-1) ... Setting up krb5-locales (1.20.1-1) ... Setting up libkrb5support0:arm64 (1.20.1-1) ... Setting up libncursesw6:arm64 (6.4-2) ... Setting up libk5crypto3:arm64 (1.20.1-1) ... Setting up libkrb5-3:arm64 (1.20.1-1) ... Setting up openssl (3.0.8-1) ... Setting up readline-common (8.2-1.3) ... Setting up libreadline8:arm64 (8.2-1.3) ... Setting up ca-certificates (20230311) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/aarch64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Updating certificates in /etc/ssl/certs... 140 added, 0 removed; done. Setting up libgssapi-krb5-2:arm64 (1.20.1-1) ... Setting up libtirpc3:arm64 (1.3.3+ds-1) ... Setting up libnsl2:arm64 (1.3.0-2) ... Setting up libpython3.11-stdlib:arm64 (3.11.2-4) ... Setting up libpython3-stdlib:arm64 (3.11.2-1) ... Setting up python3.11 (3.11.2-4) ... Setting up python3 (3.11.2-1) ... running python rtupdate hooks for python3.11... running python post-rtupdate hooks for python3.11... Processing triggers for libc-bin (2.36-8) ... Processing triggers for ca-certificates (20230311) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. bash: /usr/bin/systemctl3.py: Permission denied Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: psmisc 0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded. Need to get 257 kB of archives. After this operation, 1185 kB of additional disk space will be used. Get:1 http://deb.debian.org/debian bookworm/main arm64 psmisc arm64 23.6-1 [257 kB] Fetched 257 kB in 1s (460 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package psmisc. (Reading database ... 7345 files and directories currently installed.) Preparing to unpack .../psmisc_23.6-1_arm64.deb ... Unpacking psmisc (23.6-1) ... Setting up psmisc (23.6-1) ... Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: iproute2 libatm1 libbpf1 libbsd0 libcap2-bin libelf1 libmnl0 libpam-cap libxtables12 Suggested packages: iproute2-doc fcgiwrap nginx-doc ssl-cert The following NEW packages will be installed: iproute2 libatm1 libbpf1 libbsd0 libcap2-bin libelf1 libmnl0 libpam-cap libxtables12 nginx 0 upgraded, 10 newly installed, 0 to remove and 7 not upgraded. Need to get 2112 kB of archives. After this operation, 8337 kB of additional disk space will be used. Get:1 http://deb.debian.org/debian bookworm/main arm64 libelf1 arm64 0.188-2.1 [173 kB] Get:2 http://deb.debian.org/debian bookworm/main arm64 libbpf1 arm64 1:1.1.0-1 [136 kB] Get:3 http://deb.debian.org/debian bookworm/main arm64 libbsd0 arm64 0.11.7-2 [115 kB] Get:4 http://deb.debian.org/debian bookworm/main arm64 libmnl0 arm64 1.0.4-3 [12.1 kB] Get:5 http://deb.debian.org/debian bookworm/main arm64 libxtables12 arm64 1.8.9-2 [29.6 kB] Get:6 http://deb.debian.org/debian bookworm/main arm64 libcap2-bin arm64 1:2.66-3 [33.9 kB] Get:7 http://deb.debian.org/debian bookworm/main arm64 iproute2 arm64 6.1.0-2 [1008 kB] Get:8 http://deb.debian.org/debian bookworm/main arm64 libatm1 arm64 1:2.5.1-4+b2 [67.7 kB] Get:9 http://deb.debian.org/debian bookworm/main arm64 libpam-cap arm64 1:2.66-3 [14.5 kB] Get:10 http://deb.debian.org/debian bookworm/main arm64 nginx arm64 1.22.1-7 [522 kB] Fetched 2112 kB in 2s (1277 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libelf1:arm64. (Reading database ... 7465 files and directories currently installed.) Preparing to unpack .../0-libelf1_0.188-2.1_arm64.deb ... Unpacking libelf1:arm64 (0.188-2.1) ... Selecting previously unselected package libbpf1:arm64. Preparing to unpack .../1-libbpf1_1%3a1.1.0-1_arm64.deb ... Unpacking libbpf1:arm64 (1:1.1.0-1) ... Selecting previously unselected package libbsd0:arm64. Preparing to unpack .../2-libbsd0_0.11.7-2_arm64.deb ... Unpacking libbsd0:arm64 (0.11.7-2) ... Selecting previously unselected package libmnl0:arm64. Preparing to unpack .../3-libmnl0_1.0.4-3_arm64.deb ... Unpacking libmnl0:arm64 (1.0.4-3) ... Selecting previously unselected package libxtables12:arm64. Preparing to unpack .../4-libxtables12_1.8.9-2_arm64.deb ... Unpacking libxtables12:arm64 (1.8.9-2) ... Selecting previously unselected package libcap2-bin. Preparing to unpack .../5-libcap2-bin_1%3a2.66-3_arm64.deb ... Unpacking libcap2-bin (1:2.66-3) ... Selecting previously unselected package iproute2. Preparing to unpack .../6-iproute2_6.1.0-2_arm64.deb ... Unpacking iproute2 (6.1.0-2) ... Selecting previously unselected package libatm1:arm64. Preparing to unpack .../7-libatm1_1%3a2.5.1-4+b2_arm64.deb ... Unpacking libatm1:arm64 (1:2.5.1-4+b2) ... Selecting previously unselected package libpam-cap:arm64. Preparing to unpack .../8-libpam-cap_1%3a2.66-3_arm64.deb ... Unpacking libpam-cap:arm64 (1:2.66-3) ... Selecting previously unselected package nginx. Preparing to unpack .../9-nginx_1.22.1-7_arm64.deb ... Unpacking nginx (1.22.1-7) ... Setting up libatm1:arm64 (1:2.5.1-4+b2) ... Setting up libcap2-bin (1:2.66-3) ... Setting up libmnl0:arm64 (1.0.4-3) ... Setting up libxtables12:arm64 (1.8.9-2) ... Setting up libbsd0:arm64 (0.11.7-2) ... Setting up libelf1:arm64 (0.188-2.1) ... Setting up libpam-cap:arm64 (1:2.66-3) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/aarch64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Setting up libbpf1:arm64 (1:1.1.0-1) ... Setting up iproute2 (6.1.0-2) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/aarch64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype Setting up nginx (1.22.1-7) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/aarch64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.) debconf: falling back to frontend: Teletype invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of start. Processing triggers for libc-bin (2.36-8) ... bash: /usr/bin/systemctl3.py: Permission denied

Many thanks for your time. Sorry for the late reply.
Now the problem is Permission Denied while any command running using systemctl3.py
What am I doing wrong?

from docker-systemctl-replacement.

MekayelAnik avatar MekayelAnik commented on September 2, 2024

Permission denied solved by chmod +x systemctl3.py
I will complete my real endeavor.
After that will close the issue. Thanks for your reply.

from docker-systemctl-replacement.

MekayelAnik avatar MekayelAnik commented on September 2, 2024

problem solved! Much appreciated man! You are saving alot of hair from pulling out. (Y)

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 2, 2024

@williamdes

I have built this:

 FROM debian:bullseye

 # See: https://github.com/Normation/rudder-packages
 RUN echo "deb [trusted=yes] http://repository.rudder.io/apt/7.2/ bullseye main" > /etc/apt/sources.list.d/rudder.list && \
    apt-get update && \
    apt-get install systemd apache2 rsync gpg -y && \
    # Remove systemd installed services new systemctl does not like them
    dpkg -L systemd | grep ".service$" | tr '\n' '\0' | xargs -0 -n1 -i rm -v {} && \
    apt-get install rudder-external-db -y && \
    apt-get install --download-only rudder-server rudder-relay -y

 COPY files/docker/systemctl3.py /bin/systemctl

 # See: https://askubuntu.com/a/482936/432270
 RUN \
    dpkg --unpack /var/cache/apt/archives/rudder-server_*.deb && \
    dpkg --unpack /var/cache/apt/archives/rudder-relay_*.deb && \
    #cat /opt/rudder/share/package-scripts/rudder-* && \
    #mv -v /var/lib/dpkg/info/rudder-server.postinst /root/ && \
    mv -v /var/lib/dpkg/info/rudder-relay.postinst /root/ && \
    #apt-get install rudder-server rudder-relay -y && \
    apt-get install -fy && \
    #dpkg --configure rudder-server && \
    #dpkg --configure rudder-relay && \
    ls -lah ./ && \
    apt-get clean && \
    rm -rv /var/cache/apt/archives /var/lib/apt/lists/* && \
    rm -rv /var/log/apt/* /var/log/dpkg.log /var/log/alternatives.log

When enterring the container, "which systemctl" shows a good systemctl3.py and "systemctl start rudder-server" succeeds.

While building I was warned about "please install buildkit" which I don't have. So hopefully the problem doesnt come from the docker-build scripting being not able to get a clean download?

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 2, 2024

Anyway..... I can not reproduce the problem. Still guessing it is not in the python code.

from docker-systemctl-replacement.

williamdes avatar williamdes commented on September 2, 2024

Did you try my dockerfile?
If you remove the service removal line it will fail on each system service
I can help you reproduce this issue if you don't succeed

from docker-systemctl-replacement.

williamdes avatar williamdes commented on September 2, 2024

Ah yes, maybe give a try to docker buildx if it helps
But it's on my long TODO list to come back to this topic

from docker-systemctl-replacement.

williamdes avatar williamdes commented on September 2, 2024

Thank you for your fixes, I am closing my request/comment now
It's most probably fixed since it builds correctly

from docker-systemctl-replacement.

andreikutsko avatar andreikutsko commented on September 2, 2024

I have similar issue in rocky8
15:18:41 ERROR:systemctl: systemd-exit.service: a .service file without [Service] section
15:18:41 ERROR:systemctl: systemd-poweroff.service: a .service file without [Service] section
15:18:41 ERROR:systemctl: systemd-reboot.service: a .service file without [Service] section
My first question is - Does the script work on rocky 8?

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 2, 2024

@andreikutsko - I can not test every distro flavour but the main distro lines are supported and rocky linux should be in the rhel kinship.

That said ..... are those three errors correct? Please show

systemctl cat systemd-exit.service

from docker-systemctl-replacement.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.