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

Podman cannot start on Linux due to faulty homebrew.podman.service file #18802

Open
4 tasks done
radicaled opened this issue Nov 21, 2024 · 1 comment
Open
4 tasks done
Labels
bug Reproducible Homebrew/brew bug

Comments

@radicaled
Copy link

brew gist-logs <formula> link OR brew config AND brew doctor output

brew config:

HOMEBREW_VERSION: 4.4.6
ORIGIN: https://github.com/Homebrew/brew
HEAD: cc0b5d6d05d1f3af5b2f53e9fbb1e7bfa0c332ab
Last commit: 4 days ago
Core tap JSON: 21 Nov 00:46 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :1
HOMEBREW_MAKE_JOBS: 16
Homebrew Ruby: 3.3.6 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby
CPU: 16-core 64-bit zen5
Clang: N/A
Git: 2.34.1 => /bin/git
Curl: 7.81.0 => /bin/curl
Kernel: Linux 6.9.3-76060903-generic x86_64 GNU/Linux
OS: Pop!_OS 22.04 LTS (jammy)
Host glibc: 2.35
/usr/bin/gcc: 11.4.0
/usr/bin/ruby: N/A
glibc: N/A
gcc@11: N/A
gcc: 14.2.0_1
xorg: N/A

brew doctor:

Your system is ready to brew.

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

Installed podman and tried to start the service via brew services start podman.

What happened (include all command output)?

==> Successfully started podman (label: homebrew.podman)

Despite the message, podman did not start.

These loglines were present in systemd logs when using journalctl --user -u homebrew.podman

Nov 20 17:49:22 pop-os systemd[1687]: Started Homebrew generated unit for podman.
Nov 20 17:49:22 pop-os podman[113259]: Error: unknown flag: --time\
Nov 20 17:49:22 pop-os podman[113259]: See 'podman system service --help'
Nov 20 17:49:22 pop-os systemd[1687]: homebrew.podman.service: Main process exited, code=exited, status=125/n/a
Nov 20 17:49:22 pop-os systemd[1687]: homebrew.podman.service: Failed with result 'exit-code'.

Inspecting the Homebrew generated homebrew.podman.service reveals a problem with this particular line:

ExecStart=/home/linuxbrew/.linuxbrew/opt/podman/bin/podman system service --time\=0.

The backslash here prevents the systemd from starting the service.

What did you expect to happen?

Podman to start.

Step-by-step reproduction instructions (by running brew commands)

- `brew install podman`
- `brew services start podman`
@radicaled radicaled added the bug Reproducible Homebrew/brew bug label Nov 21, 2024
@SMillerDev SMillerDev transferred this issue from Homebrew/homebrew-core Nov 21, 2024
@MikeMcQuaid MikeMcQuaid transferred this issue from Homebrew/homebrew-services Nov 22, 2024
@ZhongRuoyu ZhongRuoyu transferred this issue from Homebrew/homebrew-core Nov 22, 2024
@ZhongRuoyu
Copy link
Member

ZhongRuoyu commented Nov 22, 2024

This seems to rather be an issue regarding how we handle shell quoting when generating systemd service files. The \= escape in the ExecStart line, generated by Utils::Shell#shell_quote 1, is not a valid escape in systemd 2 so it is instead treated as two characters.

So, I think we may need to "drop back to the original approach" as mentioned in #15880 (comment) (i.e., use the initial approach in #15875). EDIT: That doesn't handle the case where there is single quote in the argument. Escapes are hard to handle :(

EDIT 2: Perhaps we could implement a systemd_escape method that does the same as unit_name_escape in systemd 3?

Footnotes

  1. service: handle quoting in service file, too. #15880

  2. https://www.freedesktop.org/software/systemd/man/latest/systemd.syntax.html#Quoting

  3. https://github.com/systemd/systemd/blob/2ccacdd57ca07d9c6512c773dda4255cb776204c/src/basic/unit-name.c#L334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/brew bug
Projects
None yet
Development

No branches or pull requests

2 participants