Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sysutils/conmon: Fix podman's restart-policy handling
Approved-by: dch Differential Revision: https://reviews.freebsd.org/D40437
- Loading branch information
Doug Rabson
authored and
Doug Rabson
committed
Jun 12, 2023
1 parent
3a1f435
commit c85ba97
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- src/close_fds.c.orig 2023-02-28 02:39:11 UTC | ||
+++ src/close_fds.c | ||
@@ -22,6 +22,12 @@ | ||
|
||
#include <sys/stat.h> | ||
|
||
+#ifdef __FreeBSD__ | ||
+#define OPEN_FILES_DIR "/dev/fd" | ||
+#else | ||
+#define OPEN_FILES_DIR "/proc/self/fd" | ||
+#endif | ||
+ | ||
static int open_files_max_fd; | ||
static fd_set *open_files_set; | ||
|
||
@@ -31,7 +37,7 @@ static void __attribute__((constructor)) init() | ||
ssize_t size = 0; | ||
DIR *d; | ||
|
||
- d = opendir("/proc/self/fd"); | ||
+ d = opendir(OPEN_FILES_DIR); | ||
if (!d) | ||
return; | ||
|
||
@@ -85,7 +91,7 @@ void close_all_fds_ge_than(int firstfd) | ||
struct dirent *ent; | ||
DIR *d; | ||
|
||
- d = opendir("/proc/self/fd"); | ||
+ d = opendir(OPEN_FILES_DIR); | ||
if (!d) | ||
return; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ | ||
{ type: install | ||
message: <<EOM | ||
|
||
To properly support podman's container restart policy, conmon needs fdescfs(5) | ||
to be mounted on /dev/fd. | ||
|
||
If /dev/fd is not already mounted: | ||
|
||
mount -t fdescfs fdesc /dev/fd | ||
|
||
To make it permanent, add the following line to /etc/fstab: | ||
|
||
fdesc /dev/fd fdescfs rw 0 0 | ||
EOM | ||
} | ||
] |