Issue
$ docker run -it --name systemd-tutorial ubuntu
ro[email protected]:~# systemctl
bash: systemctl: command not found
why??
The systemctl utility, which is available by default in Ubuntu, can be used to list services in Ubuntu 22.04 using the command “systemctl –no-pager”.
my version:
[email protected]:~# cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
...
Solution
why?
Containers, typically used for single -service jobs, typically come without the full systemd suite of service management, which would have trouble running without access to the system dbus, anyway. So, this is kind of expected.
Answered By - Marcus Müller Answer Checked By - Senaida (WPSolving Volunteer)