-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Bug]: ignition_linux.go failed on systemd-free Linux due to lack of timedatectl
executable
#17244
Comments
Thanks for reaching out! The idea sounds good to me. I suggest to do a Are you interested in opening a PR? |
Thanks, too, for your precious time. |
This sounds reasonable but AFAIK /etc/timezone does not have to exist either. It doesn't exists on my fedora install, properly the reason why we used timedatectl in the first place. |
Thank you for your detailed feedbacks. I agree My opinion is not to replace if timedatectl is missing {
read /etc/timezone
} else {
default aka timedatectl
} It aims to mitigate failure of the specific case.
Definitely 😅 I am grateful to you. |
I sent PR #17264 . Test done:
|
…t_on_systemd_free_linux fix #17244: use /etc/timezone where `timedatectl` is missing on Linux
…g on Linux Signed-off-by: nabbisen <nabbisen@scqr.net>
…g on Linux [NO NEW TESTS NEEDED] Signed-off-by: nabbisen <nabbisen@scqr.net> Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
[v4.4] fix #17244: use /etc/timezone where `timedatectl` is missing on Linux
Issue Description
My machine is Artix Linux, based on Arch Linux and using OpenRC instead of systemd.
getLocalTimeZone
inignition_linux.go
executestimedatectl
, which is a part of systemd. Therefore, it failed in my env, and.ign
was not created.Steps to reproduce the issue
Steps to reproduce the issue
podman machine init
Describe the results you received
podman-machine-default.ign
was not created, runningpodman machine start
in the next step also failed with the error:Describe the results you expected
podman machine init
is successful with systemd-free Linux.podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
-
Additional information
I made a custom Rust script to print my timezone named "timedatectl". After it built and placed in
$PATH
,podman machine init
succeeded. The.ign
file was created with content written.In my opinion, on systemd-free Linux,
exec.Command("timedatectl", "show", "--property=Timezone").Output()
should be replaced withexec.Command("cat", "/etc/timezone").Output()
inignition_linux.go
. For example:The text was updated successfully, but these errors were encountered: