aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-07-24 00:42:12 -0700
committerChris Lu <chris.lu@gmail.com>2019-07-24 00:42:12 -0700
commit344ce90315cfe0f67d7952947083d8c6b926969f (patch)
tree443c8d43de564f9e5af9b9a78b3c57baac2a9063 /weed/command
parent5956dfd08d690ee67bcd4a7f5730785f7a6df201 (diff)
downloadseaweedfs-344ce90315cfe0f67d7952947083d8c6b926969f.tar.xz
seaweedfs-344ce90315cfe0f67d7952947083d8c6b926969f.zip
remove weedfuse
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/weedfuse/README.md84
-rw-r--r--weed/command/weedfuse/weedfuse.go109
2 files changed, 0 insertions, 193 deletions
diff --git a/weed/command/weedfuse/README.md b/weed/command/weedfuse/README.md
deleted file mode 100644
index 1a1496bbb..000000000
--- a/weed/command/weedfuse/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-Mount the SeaweedFS via FUSE
-
-# Mount by fstab
-
-
-```
-$ # on linux
-$ sudo apt-get install fuse
-$ sudo echo 'user_allow_other' >> /etc/fuse.conf
-$ sudo mv weedfuse /sbin/mount.weedfuse
-
-$ # on Mac
-$ sudo mv weedfuse /sbin/mount_weedfuse
-
-```
-
-On both OS X and Linux, you can add one of the entries to your /etc/fstab file like the following:
-
-```
-# mount the whole SeaweedFS
-localhost:8888/ /home/some/mount/folder weedfuse
-
-# mount the SeaweedFS sub folder
-localhost:8888/sub/dir /home/some/mount/folder weedfuse
-
-# mount the SeaweedFS sub folder with some options
-localhost:8888/sub/dir /home/some/mount/folder weedfuse user
-
-```
-
-To verify it can work, try this command
-```
-$ sudo mount -av
-
-...
-
-/home/some/mount/folder : successfully mounted
-
-```
-
-If you see `successfully mounted`, try to access the mounted folder and verify everything works.
-
-
-To debug, run these:
-```
-
-$ weedfuse -foreground localhost:8888/ /home/some/mount/folder
-
-```
-
-
-To unmount the folder:
-```
-
-$ sudo umount /home/some/mount/folder
-
-```
-
-<!-- not working yet!
-
-# Mount by autofs
-
-AutoFS can mount a folder if accessed.
-
-```
-# install autofs
-$ sudo apt-get install autofs
-```
-
-Here is an example on how to mount a folder for all users under `/home` directory.
-Assuming there exists corresponding folders under `/home` on both local and SeaweedFS.
-
-Edit `/etc/auto.master` and `/etc/auto.weedfuse` file with these content
-```
-$ cat /etc/auto.master
-/home /etc/auto.weedfuse
-
-$ cat /etc/auto.weedfuse
-# map /home/<user> to localhost:8888/home/<user>
-* -fstype=weedfuse,rw,allow_other,foreground :localhost\:8888/home/&
-
-```
-
--->
diff --git a/weed/command/weedfuse/weedfuse.go b/weed/command/weedfuse/weedfuse.go
deleted file mode 100644
index 4c0d12874..000000000
--- a/weed/command/weedfuse/weedfuse.go
+++ /dev/null
@@ -1,109 +0,0 @@
-package main
-
-import (
- "flag"
- "fmt"
- "os"
- "strings"
-
- "github.com/chrislusf/seaweedfs/weed/command"
- "github.com/chrislusf/seaweedfs/weed/glog"
- "github.com/jacobsa/daemonize"
- "github.com/kardianos/osext"
-)
-
-var (
- fuseCommand = flag.NewFlagSet("weedfuse", flag.ContinueOnError)
- options = fuseCommand.String("o", "", "comma separated options rw,uid=xxx,gid=xxx")
- isForeground = fuseCommand.Bool("foreground", false, "starts as a daemon")
-)
-
-func main() {
-
- err := fuseCommand.Parse(os.Args[1:])
- if err != nil {
- glog.Fatal(err)
- }
- fmt.Printf("options: %v\n", *options)
-
- // seems this value is always empty, need to parse it differently
- optionsString := *options
- prev := ""
- for i, arg := range os.Args {
- fmt.Printf("args[%d]: %v\n", i, arg)
- if prev == "-o" {
- optionsString = arg
- }
- prev = arg
- }
-
- device := fuseCommand.Arg(0)
- mountPoint := fuseCommand.Arg(1)
-
- fmt.Printf("source: %v\n", device)
- fmt.Printf("target: %v\n", mountPoint)
-
- nouser := true
- for _, option := range strings.Split(optionsString, ",") {
- fmt.Printf("option: %v\n", option)
- switch option {
- case "user":
- nouser = false
- }
- }
-
- maybeSetupPath()
-
- if !*isForeground {
- startAsDaemon()
- return
- }
-
- parts := strings.SplitN(device, "/", 2)
- filer, filerPath := parts[0], parts[1]
-
- command.RunMount(
- filer, "/"+filerPath, mountPoint, "", "000", "",
- 4, !nouser, 0, 1000000)
-
-}
-
-func maybeSetupPath() {
- // sudo mount -av may not include PATH in some linux, e.g., Ubuntu
- hasPathEnv := false
- for _, e := range os.Environ() {
- if strings.HasPrefix(e, "PATH=") {
- hasPathEnv = true
- }
- fmt.Println(e)
- }
- if !hasPathEnv {
- os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
- }
-}
-
-func startAsDaemon() {
-
- // adapted from gcsfuse
-
- // Find the executable.
- var path string
- path, err := osext.Executable()
- if err != nil {
- glog.Fatalf("osext.Executable: %v", err)
- }
-
- // Set up arguments. Be sure to use foreground mode.
- args := append([]string{"-foreground"}, os.Args[1:]...)
-
- // Pass along PATH so that the daemon can find fusermount on Linux.
- env := []string{
- fmt.Sprintf("PATH=%s", os.Getenv("PATH")),
- }
-
- err = daemonize.Run(path, args, env, os.Stdout)
- if err != nil {
- glog.Fatalf("daemonize.Run: %v", err)
- }
-
-}