mirror of
https://github.com/containers/podman-compose.git
synced 2025-05-02 05:14:42 +02:00
Merge pull request #1135 from rpluem-vf/keep_fds_open
Do not close file descriptors when executing podman
This commit is contained in:
commit
15380a809d
4
newsfragments/do_not_close_fds.feature
Normal file
4
newsfragments/do_not_close_fds.feature
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
- Do not close file descriptors when executing podman. This allows
|
||||||
|
externally created file descriptors to be passed to containers.
|
||||||
|
These file descriptors might have been created through
|
||||||
|
[systemd socket activation](https://github.com/containers/podman/blob/main/docs/tutorials/socket_activation.md#socket-activation-of-containers).
|
@ -1506,7 +1506,10 @@ class Podman:
|
|||||||
|
|
||||||
if log_formatter is not None:
|
if log_formatter is not None:
|
||||||
p = await asyncio.create_subprocess_exec(
|
p = await asyncio.create_subprocess_exec(
|
||||||
*cmd_ls, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
|
*cmd_ls,
|
||||||
|
stdout=asyncio.subprocess.PIPE,
|
||||||
|
stderr=asyncio.subprocess.PIPE,
|
||||||
|
close_fds=False,
|
||||||
) # pylint: disable=consider-using-with
|
) # pylint: disable=consider-using-with
|
||||||
|
|
||||||
# This is hacky to make the tasks not get garbage collected
|
# This is hacky to make the tasks not get garbage collected
|
||||||
@ -1524,7 +1527,7 @@ class Podman:
|
|||||||
err_t.add_done_callback(task_reference.discard)
|
err_t.add_done_callback(task_reference.discard)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
p = await asyncio.create_subprocess_exec(*cmd_ls) # pylint: disable=consider-using-with
|
p = await asyncio.create_subprocess_exec(*cmd_ls, close_fds=False) # pylint: disable=consider-using-with
|
||||||
|
|
||||||
try:
|
try:
|
||||||
exit_code = await p.wait()
|
exit_code = await p.wait()
|
||||||
|
Loading…
Reference in New Issue
Block a user