mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
enhance.create mount dir if not exist automiclly
Signed-off-by: leonrayang <chl696@sina.com>
This commit is contained in:
parent
68262d4183
commit
108d7af81c
@ -311,6 +311,14 @@ func main() {
|
||||
}
|
||||
defer log.LogFlush()
|
||||
|
||||
if _, err = os.Stat(opt.MountPoint); err != nil {
|
||||
if err = os.Mkdir(opt.MountPoint, os.ModePerm); err != nil {
|
||||
err = errors.NewErrorf("Init.MountPoint mkdir failed error %v\n", err)
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
_, err = stat.NewStatistic(opt.Logpath, LoggerPrefix, int64(stat.DefaultStatLogSize),
|
||||
stat.DefaultTimeOutUs, true)
|
||||
if err != nil {
|
||||
@ -670,7 +678,6 @@ func parseMountOption(cfg *config.Config) (*proto.MountOptions, error) {
|
||||
if err != nil {
|
||||
return nil, errors.Trace(err, "invalide mount point (%v) ", rawmnt)
|
||||
}
|
||||
|
||||
opt.Volname = GlobalMountOptions[proto.VolName].GetString()
|
||||
opt.Owner = GlobalMountOptions[proto.Owner].GetString()
|
||||
opt.Master = GlobalMountOptions[proto.Master].GetString()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user