Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing feature systemd/systemctl? #9886

Open
TheOnlyWei opened this issue Jul 19, 2024 · 3 comments
Open

Missing feature systemd/systemctl? #9886

TheOnlyWei opened this issue Jul 19, 2024 · 3 comments
Labels
feature-request Request for a feature or enhancement

Comments

@TheOnlyWei
Copy link

Is your feature request related to a problem? Please describe.
I would like the core Azure Linux Mariner image to contain systemctl command as advertised by this document:
https://microsoft.github.io/azurelinux/docs/#managing-services-with-systemd

However, the latest version (mcr.microsoft.com/cbl-mariner/base/core:2.0.20240628) doesn't seem to have systemctl command.

root [ / ]# systemctl
bash: systemctl: command not found

This is the version I am using. Let me know if I am using the wrong one.

docker pull mcr.microsoft.com/cbl-mariner/base/core:2.0.20240628

Describe the solution you'd like
Have systemctl available for Azure Linux Mariner.

@TheOnlyWei TheOnlyWei added the feature-request Request for a feature or enhancement label Jul 19, 2024
@TheOnlyWei TheOnlyWei changed the title Missing feature ssytemd or systemctl? Missing feature systemd or systemctl? Jul 19, 2024
@TheOnlyWei TheOnlyWei changed the title Missing feature systemd or systemctl? Missing feature systemd/systemctl? Jul 19, 2024
@elsaco
Copy link

elsaco commented Jul 19, 2024

@TheOnlyWei this is the core version! Try the full version if you want systemd or run tdnf install systemd

@TheOnlyWei
Copy link
Author

TheOnlyWei commented Jul 19, 2024

@elsaco

  1. Do you have a link to the version? I don't find any "full" versions when I search "mariner" in the Microsoft Artifact Registry:
    https://mcr.microsoft.com/en-us/catalog?search=mariner

  2. If I install it with tdnf install systemd -y, it doesn't work in the container due to this error:

root [ / ]# systemctl
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
  1. Here is a README inside the /etc/init.d folder of the core version saying systemd should be installed:
root [ /etc/init.d ]# cat README
You are looking for the traditional init scripts in /etc/rc.d/init.d,
and they are gone?

Here's an explanation on what's going on:

You are running a systemd-based OS where traditional init scripts have
been replaced by native systemd services files. Service files provide
very similar functionality to init scripts. To make use of service
files simply invoke "systemctl", which will output a list of all
currently running services (and other units). Use "systemctl
list-unit-files" to get a listing of all known unit files, including
stopped, disabled and masked ones. Use "systemctl start
foobar.service" and "systemctl stop foobar.service" to start or stop a
service, respectively. For further details, please refer to
systemctl(1).

Note that traditional init scripts continue to function on a systemd
system. An init script /etc/rc.d/init.d/foobar is implicitly mapped
into a service unit foobar.service during system initialization.

Thank you!

Further reading:
        man:systemctl(1)
        man:systemd(1)
        http://0pointer.de/blog/projects/systemd-for-admins-3.html
        https://www.freedesktop.org/wiki/Software/systemd/Incompatibilities

So, we can't use the alternative either. This makes this seem like a bug.

@trungams
Copy link
Member

@TheOnlyWei this is a late reply, but systemd is not available, and generally not needed/recommended in containers. To use systemctl command in Azure Linux, you can follow this quick start guide to create a VM on Hyper-V. Then you can use systemctl to manage services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for a feature or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants