Skip to content

Conversation

Victrid
Copy link
Contributor

@Victrid Victrid commented May 23, 2025

What problem are we solving?

Make fuse only able on linux and macos to prevent futural platform-specific compile errors.

#6809 (comment)

This also change the signal to comply

it seems that windows does not have SIGUSR1 (macOS have them as POSIX requires) causing building errors, and commit f3d44b1 changes the listening signal to SIGTERM. In this case, this code should also be changed to SIGTERM to send correct signal:

err = syscall.Kill(mountOptions.fuseCommandPid, syscall.SIGUSR1)

How are we solving the problem?

This pull request refactors the runFuse implementation to improve platform-specific handling and updates the signal used for parent process notification in the RunMount function. The primary changes involve splitting the runFuse logic into platform-specific files and modifying the signal sent to the parent process.

Platform-specific handling of runFuse:

  • Removed old implementation: The runFuse function and its dependencies were removed from weed/command/fuse.go to allow for platform-specific implementations.
  • Added non-supported platform handling: A new weed/command/fuse_notsupported.go file was added to handle cases where FUSE is not supported (e.g., non-Linux and non-Darwin platforms). It outputs an appropriate message and returns true.
  • Added Linux/Darwin-specific implementation: A new weed/command/fuse_std.go file was added, containing the runFuse implementation for Linux and Darwin platforms. This file retains the logic from the original runFuse function.

Signal modification in RunMount:

  • Changed signal type: The signal sent to the parent process in RunMount was changed from SIGUSR1 to SIGTERM, ensuring compatibility with the new runFuse implementation.

How is the PR tested?

Running the following command:

for os in linux windows darwin; do 
  GOOS=$os go build -o weed-$os
done

No error reported.

Checks

  • I have added unit tests if possible.
  • I will add related wiki document changes and link to this PR after merging.

@chrislusf
Copy link
Collaborator

What about BSDs?

@Victrid
Copy link
Contributor Author

Victrid commented May 23, 2025

I think the weed mount option is not available in freebsd and openbsd and so weed fuse.
The following command compiles without error:

for os in freebsd openbsd; do         
  GOOS=$os go build -o weed-$os
done

What is wrong with failing Ceph S3 tests? I think the code I've changed would not touch these things 🤔

@chrislusf chrislusf merged commit ea70d17 into seaweedfs:master May 23, 2025
7 of 8 checks passed
@Victrid Victrid deleted the fuse-split-patch branch May 24, 2025 10:14
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.

2 participants