docker-systemctl-replacement: 'systemctl' not working
I have manually copied code from @https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py and pasted in the systemctl3.py using ‘nano’ in a “debian:bookworm-slim” container. then copied the systemctl3.py file as:
/usr/bin/systemctl
Then if I run: systemctl daemon-reload
the output is:
root@debian-dev-environment:/# cp systemctl3.py usr/bin/systemctl
root@debian-dev-environment:/# systemctl daemon-reload
ERROR:systemctl: getty-static.service: Service Executable path is not absolute.
ERROR:systemctl: initrd-cleanup.service: Service Executable path is not absolute.
ERROR:systemctl: initrd-parse-etc.service: Service Executable path is not absolute.
ERROR:systemctl: initrd-switch-root.service: Service Executable path is not absolute.
ERROR:systemctl: system-update-cleanup.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-ask-password-console.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-ask-password-wall.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-exit.service: a .service file without [Service] section
ERROR:systemctl: systemd-firstboot.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-halt.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-journal-flush.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-journal-flush.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-kexec.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-machine-id-commit.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-networkd.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-poweroff.service: a .service file without [Service] section
ERROR:systemctl: systemd-reboot.service: a .service file without [Service] section
ERROR:systemctl: systemd-sysext.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-sysext.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-sysusers.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-tmpfiles-clean.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-tmpfiles-setup-dev.service: Service Executable path is not absolute.
ERROR:systemctl: systemd-tmpfiles-setup.service: Service Executable path is not absolute.`
if I start or stop a service using systemctl start some.service
no error is returned neither the service is started. the same happens when I do systemctl stop some.service
p.s. python3
, systemd
are already installed into the container
I have reproduced the same problem in my dietpi machine.
Maybe I am doing something wrong. In dire need of help.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (7 by maintainers)
Commits related to this issue
- #155 igno kmod — committed to gdraheim/docker-systemctl-replacement by gdraheim a year ago
- #155 igno kmod — committed to gdraheim/docker-systemctl-replacement by gdraheim a year ago
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 useddpkg -L systemd | grep ".service$" | tr '\n' '\0' | xargs -0 -n1 -i rm -v {}
to remove themActually, 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
The only thing that stands out is “kmod”. I am adding that to the igno-list.
this helped. Thanks
@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.