nofus

Crates.ionofus
lib.rsnofus
version0.4.0
created_at2025-02-26 21:44:34.260391+00
updated_at2025-09-15 16:06:52.028262+00
descriptionA daemon for monitoring and reacting to the status of NFS mounts.
homepagehttps://github.com/kariudo/nofus
repositoryhttps://github.com/kariudo/nofus
max_upload_size
id1570972
size32,846
Hunter Horsman (kariudo)

documentation

README

πŸš€ Nofus - The NFS Mount Guardian

Rust License CI/CD

Nofus is a πŸ”₯ blazingly-fast, 🧠 memory-safe, πŸ”‹ batteries-included, πŸ’Ίergonomic, πŸ¦€ 100% Rust-powered daemon that vigilantly monitors your NFS mounts and triggers custom actions based on their availability. Never get caught with stale mounts again! πŸ›‘οΈ

Important GIF

✨ Features

  • πŸ•΅οΈ Real-time NFS Mount Monitoring using Linux inotify
  • ⚑ Configurable System Commands for mount/unmount events
  • πŸ§ͺ Dry-Run Mode for safe testing
  • πŸ“Š Verbose Logging for deep insights
  • πŸ”„ Periodic Health Checks (configurable interval)
  • πŸ“ YAML Configuration for easy setup

πŸ“¦ Installation

  1. Prerequisites: If you want to run the project from source, or install from cargo directly. Ensure you have Rust installed (1.60+)

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
  2. Install Nofus:

    cargo install nofus
    

βš™οΈ Configuration

Create config.yml in your $HOME/.config/nofus directory:

# Sample Configuration
mount_points:
  - "/mnt/nfs/share1"
  - "/media/cloud_storage"

delay_seconds: 5  # Check interval

# Commands to execute (supports full shell syntax)
all_mounted_cmd: "systemctl start my-app.service"
any_unmounted_cmd: "systemctl stop my-app.service && wall 'NFS Crisis!'"

[!TIP] If you start nofus without creating a configuration file first, one will be created from a template and nofus will exit.

🚦 Usage

nofus [OPTIONS]

Options:

  • --dry-run: Simulate without executing commands
  • --verbose: Show debug-level logging

Example:

nofus --verbose --dry-run

πŸ–₯️ Sample Workflow

2023-09-15T14:30:00 [INFO] Initial state: All NFS mounts available βœ…
2023-09-15T14:35:22 [ERROR] NFS mount disconnected: /mnt/nfs/share1 ❌
2023-09-15T14:35:22 [DEBUG] Executing: systemctl stop my-app.service
2023-09-15T14:36:45 [INFO] Mount recovered: /mnt/nfs/share1 βœ…

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

πŸ“œ License

MIT License - see LICENSE for details.

Made with ❀️ by kariudo | β˜• Support the developer

Commit count: 31

cargo fmt