Skip to content

Commit

Permalink
Delete recommendations to mount fdescfs (#40)
Browse files Browse the repository at this point in the history
fdescfs used to be useful to help Python more quickly close file
descriptors before exec().  But for years, Python has been using
closefrom() instead.  All versions of Python 3.9 and later do that.

Fixes #39
  • Loading branch information
asomers authored Oct 14, 2024
1 parent eacc0ba commit 32de9d5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,3 @@ me:\
net.link.bridge.pfil_onlyip=0 # Only pass IP packets when pfil is enabled
net.link.bridge.pfil_bridge=0 # Packet filter on the bridge interface
net.link.bridge.pfil_member=0 # Packet filter on the member interface
- Lots of jails or a big server? Mount `fdescfs`:

mount -t fdescfs null /dev/fd
32 changes: 0 additions & 32 deletions iocage_lib/ioc_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def __init__(
self.callback = callback
self.silent = silent

self.__check_fd_mount__()
self.__check_datasets__()

self.pool_root_dataset = Dataset(self.pool, cache=reset_cache)
Expand Down Expand Up @@ -134,34 +133,3 @@ def __check_datasets__(self):
},
_callback=self.callback)

def __check_fd_mount__(self):
"""
Checks if /dev/fd is mounted, and if not, give the user a
warning.
"""

if os.path.ismount("/dev/fd"):
# all good!

return

messages = collections.OrderedDict([
("1-NOTICE", "*" * 80),
("2-WARNING", "fdescfs(5) is not mounted, performance"
" may suffer. Please run:"),
("3-INFO", "mount -t fdescfs null /dev/fd"),
("4-WARNING", "You can also permanently mount it in"
" /etc/fstab with the following entry:"),
("5-INFO", "fdescfs /dev/fd fdescfs rw 0 0"),
("6-NOTICE", f"{'*' * 80}\n")
])

for level, msg in messages.items():
level = level.partition("-")[2]

iocage_lib.ioc_common.logit({
"level": level,
"message": msg
},
_callback=self.callback,
silent=self.silent)

0 comments on commit 32de9d5

Please sign in to comment.