Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #880 from zcc35357949/homedir_perm
Browse files Browse the repository at this point in the history
bugfix: create home dir first when runSupernode
  • Loading branch information
starnop authored Sep 12, 2019
2 parents 551df82 + 0b5656f commit 9f553e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/supernode/app/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/dragonflyoss/Dragonfly/pkg/dflog"
"github.com/dragonflyoss/Dragonfly/pkg/errortypes"
"github.com/dragonflyoss/Dragonfly/pkg/fileutils"
"github.com/dragonflyoss/Dragonfly/pkg/netutils"
"github.com/dragonflyoss/Dragonfly/pkg/stringutils"
"github.com/dragonflyoss/Dragonfly/supernode/config"
Expand Down Expand Up @@ -122,6 +123,10 @@ func setupFlags(cmd *cobra.Command, opt *Options) {

// runSuperNode prepares configs, setups essential details and runs supernode daemon.
func runSuperNode() error {
// create home dir
if err := fileutils.CreateDirectory(options.HomeDir); err != nil {
return fmt.Errorf("failed to create home dir %s: %v", options.HomeDir, err)
}
// initialize log.
if err := initLog(); err != nil {
return err
Expand Down

0 comments on commit 9f553e7

Please sign in to comment.