Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: add option to startup juicefs as system service. fix #347, link #1546 #5643

Merged
merged 4 commits into from
Feb 14, 2025

Conversation

chenjie4255
Copy link
Contributor

@chenjie4255 chenjie4255 commented Feb 11, 2025

fix #347, link #1546

When the --as-svc mount option is specified, the juicefs mount command updates the Windows registry to prepare the service definition needed by the Winfsp Launcher. After updating the registry, the juicefs mount process invokes net use to trigger the mount behavior.

https://github.com/winfsp/winfsp/wiki/WinFsp-Service-Architecture

Known limitations:

  • Only one volume can be mounted at a time when using --as-svc. Mounting more than one volume may cause unexpected behavior depending on the implementation of winfsp.
  • We essentially write the same command line to the winfsp service registry value, except for the --as-svc option, including the mount point. Therefore, when users use the “Map a network drive” feature in File Explorer, the mount process will ignore the mount point.

Test

  • Run command with "--as-svr" option to mount volume 1 at x:.
  • Disconnect volume 1 mounting from File Explorer.
  • Run command with "--as-svr" option to mount volume 2 at y:

@chenjie4255
Copy link
Contributor Author

changed to the "-d" and the "--background" options, and re-ran the previous tests.

To simplify the modification, I did not make changes to the existing stage < 3 code. (Stage was forcibly set to 3 on Windows system at earlier code)

@davies davies merged commit 2dd3897 into main Feb 14, 2025
35 checks passed
@davies davies deleted the net_use_mount branch February 14, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows mount for all user
2 participants