Skip to content

Commit

Permalink
Refactor solution. Remove systemd changes and associated bash script.
Browse files Browse the repository at this point in the history
Make call to clear rmtab from nfs.setup_directories.
Cannot use middleware setup hook because /var/db/system/nfs is not yet available at that point.
  • Loading branch information
mgrimesix committed Dec 31, 2024
1 parent d2bba78 commit 7b12a8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[Unit]
ConditionDirectoryNotEmpty=!/etc/exports.d
After=nslcd.service

[Service]
ExecStartPre=/usr/local/bin/clear_nfs_rmtab.sh
10 changes: 0 additions & 10 deletions src/freenas/usr/local/bin/clear_nfs_rmtab.sh

This file was deleted.

6 changes: 6 additions & 0 deletions src/middlewared/middlewared/plugins/nfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ def setup_directories(self):
except Exception:
self.logger.error('Unexpected failure initializing %r', path, exc_info=True)

# Clear rmtab on boot.
# We call this here because /var/db/system/nfs is not yet available
# in a middleware 'setup' hook.
if not self.middleware.call_sync('system.ready'):
self.middleware.call_sync('nfs.clear_nfs3_rmtab')

@private
async def nfs_extend(self, nfs):
keytab_has_nfs = await self.middleware.call("kerberos.keytab.has_nfs_principal")
Expand Down

0 comments on commit 7b12a8f

Please sign in to comment.