Changes:
Modified weed/command/fuse.go to add a function GetFuseCommandName to return the name of the fuse command.
Modified weed/weed.go to conditionally initialize the global HTTP client only if the command is not "fuse".
Modified weed/command/fuse_std.go to parse parameters and ensure the global HTTP client is initialized for the fuse command.
Tests:
Use /etc/fstab like:
fuse /repos fuse.weed filer=192.168.1.101:7202,filer.path=/hpc/repos,config_dir=/etc/seaweedfs/seaweedfs_01 0 0
fuse /opt/ohpc/pub fuse.weed filer=192.168.1.102:7202,filer.path=/hpc_cluster/pub,config_dir=/etc/seaweedfs/seaweedfs_02 0 0
Co-authored-by: zhangxl56 <zhangxl56@lenovo.com>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package command
|
|
|
|
func init() {
|
|
cmdFuse.Run = runFuse // break init cycle
|
|
}
|
|
|
|
var cmdFuse = &Command{
|
|
UsageLine: "fuse /mnt/mount/point -o \"filer=localhost:8888,filer.path=/\"",
|
|
Short: "Allow use weed with linux's mount command",
|
|
Long: `Allow use weed with linux's mount command
|
|
|
|
You can use -t weed on mount command:
|
|
mv weed /sbin/mount.weed
|
|
mount -t weed fuse /mnt -o "filer=localhost:8888,filer.path=/"
|
|
|
|
Or you can use -t fuse on mount command:
|
|
mv weed /sbin/weed
|
|
mount -t fuse.weed fuse /mnt -o "filer=localhost:8888,filer.path=/"
|
|
mount -t fuse "weed#fuse" /mnt -o "filer=localhost:8888,filer.path=/"
|
|
|
|
To use without mess with your /sbin:
|
|
mount -t fuse./home/user/bin/weed fuse /mnt -o "filer=localhost:8888,filer.path=/"
|
|
mount -t fuse "/home/user/bin/weed#fuse" /mnt -o "filer=localhost:8888,filer.path=/"
|
|
|
|
To pass more than one parameter use quotes, example:
|
|
mount -t weed fuse /mnt -o "filer='192.168.0.1:8888,192.168.0.2:8888',filer.path=/"
|
|
|
|
To check valid options look "weed mount --help"
|
|
`,
|
|
}
|
|
|
|
func GetFuseCommandName() string {
|
|
return cmdFuse.Name()
|
|
}
|