Closed fangpenlin closed 1 year ago
For people who are looking into workaround, such as running podman in alpine, an easy way is to simply install openrc or s6-overlay with a syslog running when the container starts, like this:
FROM alpine
RUN apk add s6-overlay s6-overlay-syslogd podman fuse fuse-overlayfs
RUN sed -e 's|^#mount_program|mount_program|g' /usr/share/containers/storage.conf > /etc/containers/storage.conf
ENTRYPOINT ["/init"]
This way, when you run with debug log level, syslog can be found and the exit won't timeout
docker run --privileged -i my-image podman --log-level=debug run -i alpine echo hi
What is the error message when you run something like: podman --syslog info
.
We should likely just ignore the error for the cleanup command.
docker run --privileged --entrypoint=/bin/sh -i alpine:3.18.2 \
-c "apk add podman fuse fuse-overlayfs && \
sed -e 's|^#mount_program|mount_program|g' /usr/share/containers/storage.conf > /etc/containers/storage.conf && \
podman --syslog info"
and the result:
Failed to initialize syslog hook: Unix syslog delivery error
Issue Description
I ran into a problem, when you run the podman command in an environment where syslog is not available with a
debug
log level, the container exit is going to timeout. For example, in an Alpine docker container withpodman
package installed, then you ran thisThen you will see after
hi
shows, it takes 20 seconds until the timeout waiting for container errorAfter tracing into the code I now understand why. The first would be, when
debug
log level is provided,--syslog
will be added to the conmon exit command arguments from herehttps://github.com/containers/podman/blob/82af41cf2a48d879e14aa6eaee1ecf26e9a6e8af/pkg/specgenutil/util.go#L304-L306
Then syslog enabled or not is from here
https://github.com/containers/podman/blob/82af41cf2a48d879e14aa6eaee1ecf26e9a6e8af/libpod/oci_conmon_common.go#L1111
As you can see the part
However, when the command runs, it sees the syslog flag is set, it will try to use it.
https://github.com/containers/podman/blob/82af41cf2a48d879e14aa6eaee1ecf26e9a6e8af/cmd/podman/syslog_common.go#L20-L24
But then it will fail because syslog was not available on my Alpine environment. So it exits with code
1
. And that's the cleanup command exits without even doing anything at all. As a result, the parent podman process will wait for the result updates set by cleanup but it will never happen.Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
Describe the results you expected
The cleanup should finish without timeout error i.e, make clean up command not fail when syslog is not available. If syslog is necessary for running with
debug
log level (I saw somewhere it mentions some communications are done with syslog?), it should display an error instead of run the command and wait until timeout.podman info output