diff --git a/weed/filer/filer_conf.go b/weed/filer/filer_conf.go index 6a746f7ba..18ed37abd 100644 --- a/weed/filer/filer_conf.go +++ b/weed/filer/filer_conf.go @@ -13,10 +13,11 @@ import ( ) const ( - DirectoryEtc = "/etc" - FilerConfName = "filer.conf" - IamConfigDirecotry = "/etc/iam" - IamIdentityFile = "identity.json" + DirectoryEtcRoot = "/etc" + DirectoryEtcSeaweedFS = "/etc/seaweedfs" + FilerConfName = "filer.conf" + IamConfigDirecotry = "/etc/iam" + IamIdentityFile = "identity.json" ) type FilerConf struct { @@ -31,7 +32,7 @@ func NewFilerConf() (fc *FilerConf) { } func (fc *FilerConf) loadFromFiler(filer *Filer) (err error) { - filerConfPath := util.NewFullPath(DirectoryEtc, FilerConfName) + filerConfPath := util.NewFullPath(DirectoryEtcSeaweedFS, FilerConfName) entry, err := filer.FindEntry(context.Background(), filerConfPath) if err != nil { if err == filer_pb.ErrNotFound { diff --git a/weed/filer/filer_on_meta_event.go b/weed/filer/filer_on_meta_event.go index 3de27da6e..d93a7e9e3 100644 --- a/weed/filer/filer_on_meta_event.go +++ b/weed/filer/filer_on_meta_event.go @@ -11,8 +11,8 @@ import ( // onMetadataChangeEvent is triggered after filer processed change events from local or remote filers func (f *Filer) onMetadataChangeEvent(event *filer_pb.SubscribeMetadataResponse) { - if DirectoryEtc != event.Directory { - if DirectoryEtc != event.EventNotification.NewParentPath { + if DirectoryEtcSeaweedFS != event.Directory { + if DirectoryEtcSeaweedFS != event.EventNotification.NewParentPath { return } } diff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.go index 02c747225..0f6d0dc47 100644 --- a/weed/server/filer_server_handlers_write_autochunk.go +++ b/weed/server/filer_server_handlers_write_autochunk.go @@ -237,7 +237,7 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque } } - if chunkOffset < fs.option.CacheToFilerLimit || strings.HasPrefix(r.URL.Path, filer.DirectoryEtc) && chunkOffset < 4*1024 { + if chunkOffset < fs.option.CacheToFilerLimit || strings.HasPrefix(r.URL.Path, filer.DirectoryEtcRoot) && chunkOffset < 4*1024 { smallContent = content } return fileChunks, md5Hash, chunkOffset, nil, smallContent diff --git a/weed/shell/command_fs_configure.go b/weed/shell/command_fs_configure.go index 565e6c66e..497ef4f9e 100644 --- a/weed/shell/command_fs_configure.go +++ b/weed/shell/command_fs_configure.go @@ -62,7 +62,7 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io var buf bytes.Buffer if err = commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { - return filer.ReadEntry(commandEnv.MasterClient, client, filer.DirectoryEtc, filer.FilerConfName, &buf) + return filer.ReadEntry(commandEnv.MasterClient, client, filer.DirectoryEtcSeaweedFS, filer.FilerConfName, &buf) }); err != nil && err != filer_pb.ErrNotFound { return err } @@ -116,7 +116,7 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io if *apply { - if err := filer.SaveAs(commandEnv.option.FilerHost, int(commandEnv.option.FilerPort), filer.DirectoryEtc, filer.FilerConfName, "text/plain; charset=utf-8", &buf); err != nil { + if err := filer.SaveAs(commandEnv.option.FilerHost, int(commandEnv.option.FilerPort), filer.DirectoryEtcSeaweedFS, filer.FilerConfName, "text/plain; charset=utf-8", &buf); err != nil { return err }