Make weed-fuse compatible with systemd-based mount (#6814)
* Make weed-fuse compatible with systemd-mount series * fix: add missing type annotation on skipAutofs param in FreeBSD build The parameter was declared without a type, causing a compile error on FreeBSD. * fix: guard hasAutofs nil dereference and make FsName conditional on autofs mode - Check option.hasAutofs for nil before dereferencing to prevent panic when RunMount is called without the flag initialized. - Only set FsName to "fuse" when autofs mode is active; otherwise preserve the descriptive server:path name for mount/df output. - Fix typo: recogize -> recognize. * fix: consistent error handling for autofs option and log ignored _netdev - Replace panic with fmt.Fprintf+return false for autofs parse errors, matching the pattern used by other fuse option parsers. - Log when _netdev option is silently stripped to aid debugging. --------- Co-authored-by: Chris Lu <chris.lu@gmail.com>
This commit is contained in:
@@ -58,6 +58,11 @@ type MountOptions struct {
|
||||
|
||||
// macOS-specific FUSE options
|
||||
novncache *bool
|
||||
|
||||
// if true, we assume autofs exists over current mount point. Autofs (the kernel one, used by systemd automount)
|
||||
// is expected to be mounted as a shim between auto-mounted fs and original mount point to provide auto mount.
|
||||
// with this option, we ignore autofs mounted on the same point.
|
||||
hasAutofs *bool
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -98,6 +103,7 @@ func init() {
|
||||
mountOptions.debugPort = cmdMount.Flag.Int("debug.port", 6061, "http port for debugging")
|
||||
mountOptions.localSocket = cmdMount.Flag.String("localSocket", "", "default to /tmp/seaweedfs-mount-<mount_dir_hash>.sock")
|
||||
mountOptions.disableXAttr = cmdMount.Flag.Bool("disableXAttr", false, "disable xattr")
|
||||
mountOptions.hasAutofs = cmdMount.Flag.Bool("autofs", false, "ignore autofs mounted on the same mountpoint (useful when systemd.automount and autofs is used)")
|
||||
mountOptions.fuseCommandPid = 0
|
||||
|
||||
// Periodic metadata flush to protect against orphan chunk cleanup
|
||||
|
||||
Reference in New Issue
Block a user