Skip to main content

Module daemon

Module daemon 

Source
Expand description

Auto-mount daemon.

Watches for newly inserted NTFS volumes and mounts them automatically — the core Mounty-like feature. Uses periodic polling of diskutil list -plist (portable, no fseventsd dependency). Can be installed as a macOS LaunchAgent for login-time auto-start.

§Design

  • Polls every 3 seconds (configurable via DaemonOptions).
  • Compares current volumes against a known-state snapshot.
  • Only mounts volumes that are unmounted and newly appeared.
  • Logs to stderr (daemon-friendly; stdout stays clean).
  • Graceful shutdown on SIGINT / SIGTERM.

§LaunchAgent

Installs ~/Library/LaunchAgents/com.kodephp.ntfs-mac.plist that runs ntfs-mac daemon at login.

Structs§

DaemonOptions
Options for the daemon.
LaunchAgentInstall
Outcome of installing the LaunchAgent.
TickResult
Result of a single daemon tick.

Functions§

install_launchagent
Install the daemon as a macOS LaunchAgent and load it into the current launchd session so it starts immediately (not just at the next login).
is_launchagent_installed
Check if the LaunchAgent is installed.
is_launchagent_loaded
Whether launchd currently has the agent loaded.
run
Run the daemon until interrupted.
uninstall_launchagent
Uninstall the LaunchAgent: unload it first (stopping the daemon), then remove the plist.