diff --git a/central_auth_key_handling.go b/central_auth_key_handling.go index 867c98c..13e4338 100644 --- a/central_auth_key_handling.go +++ b/central_auth_key_handling.go @@ -5,7 +5,6 @@ import ( "crypto/sha256" "fmt" "log" - "os" "path/filepath" "sort" "sync" @@ -77,7 +76,7 @@ func newPKI(configuration *Configuration, errorKernel *errorKernel) *pki { db, err := bolt.Open(databaseFilepath, 0600, nil) if err != nil { log.Printf("error: failed to open db: %v\n", err) - os.Exit(1) + return &p } p.db = db diff --git a/requests_copy.go b/requests_copy.go index be4ee57..3a53201 100644 --- a/requests_copy.go +++ b/requests_copy.go @@ -3,6 +3,7 @@ package steward import ( "context" "fmt" + "log" "github.com/google/uuid" ) @@ -113,6 +114,11 @@ func (m methodREQCopySrc) handler(proc process, message Message, node string) ([ func copySrcProcFunc() func(context.Context, chan Message) error { pf := func(ctx context.Context, procFuncCh chan Message) error { + select { + case <-ctx.Done(): + log.Printf(" * copySrcProcFunc ended\n") + } + return nil } diff --git a/server.go b/server.go index ccafab6..a1383a9 100644 --- a/server.go +++ b/server.go @@ -145,8 +145,16 @@ func NewServer(configuration *Configuration, version string) (*server, error) { } + //var nodeAuth *nodeAuth + //if configuration.EnableSignatureCheck { nodeAuth := newNodeAuth(configuration, errorKernel) // fmt.Printf(" * DEBUG: newServer: signatures contains: %+v\n", signatures) + //} + + //var centralAuth *centralAuth + //if configuration.IsCentralAuth { + centralAuth := newCentralAuth(configuration, errorKernel) + //} s := server{ ctx: ctx, @@ -162,7 +170,7 @@ func NewServer(configuration *Configuration, version string) (*server, error) { errorKernel: errorKernel, nodeAuth: nodeAuth, helloRegister: newHelloRegister(), - centralAuth: newCentralAuth(configuration, errorKernel), + centralAuth: centralAuth, } s.processes = newProcesses(ctx, &s)