Skip to content

[Feature]: Prevent or warn on OS shutdown/restart during active transfers (Cross-platform) #282

Description

@juanlucer

Pre-submission Checks

  • I have searched open and closed issues to confirm this feature hasn't been requested before.
  • I have checked the project roadmap / open PRs.
  • This feature aligns with RClone Manager's scope (Rclone management & file operations).

Feature Description

When running transfer, sync, or copy jobs (especially when minimized to the system tray), the operating system (Windows, macOS, or Linux) can shut down or restart without warning the user. This abruptly terminates the active rclone process, which can result in partially uploaded, corrupted, or incomplete files on the remote storage.

While this is particularly common on Windows, having a system-level shutdown prevention mechanism across all supported desktop OSs (Windows, macOS, Linux) would protect background jobs on any system.

This feature would benefit all desktop users performing long or background synchronization tasks who want to ensure data integrity and avoid accidental interruptions.

Current workaround: Manually keeping the main UI window open or using external utilities (like Microsoft PowerToys Awake / Caffeine on Windows, or caffeine / systemd-inhibit on Linux) to temporarily block OS sleep and shutdown.

Proposed Solution

Implement a native OS session/shutdown handler across desktop platforms:

Expected Behavior:

  1. When an active sync/copy job is running in Rclone Manager and the OS attempts to shut down, log out, or restart, Rclone Manager registers a blocking inhibitor or prompts the user.
  2. The operating system displays its native "An app is preventing shutdown" / "Inhibit shutdown" prompt (e.g., Windows shutdown block screen, macOS app termination prevention, or Linux desktop inhibit manager / systemd inhibition), allowing the user to either cancel the shutdown or wait for transfers to finish.
  3. Once all jobs finish, the inhibition lock is automatically released.

Feature Category

UI/UX Improvement

Applicable Platforms / Versions

  • Desktop (Windows, macOS, Linux)
  • Android (Mobile)
  • Headless (Web server / NAS / VPS)
  • Portable (Standalone executable)
  • All platforms

Mockups / Screenshots

No response

Technical Considerations

  • Cross-platform APIs:
    • Windows: Intercepting WM_QUERYENDSESSION / WM_ENDSESSION and calling ShutdownBlockReasonCreate.
    • Linux: Requesting a shutdown/sleep inhibitor lock via DBus (org.freedesktop.PowerManagement.Inhibit or org.gnome.SessionManager).
    • macOS: Using NSProcessInfo activity options (NSActivityUserInitiatedAllowingIdleSystemSleep / NSActivitySuddenTerminationDisallowed).
    • Framework native: If the app is built on Electron/Tauri/Qt, leveraging built-in power/session APIs (e.g., powerSaveBlocker in Electron).
  • Applies only when active background transfer workers or rclone subprocesses are running to avoid unnecessarily blocking OS shutdowns when idle.

Additional Context

This is standard behavior in many background sync tools, download managers, and backup applications to prevent cloud data corruption during unannounced system reboots.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions