1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

changed from log package to slog

This commit is contained in:
postmannen 2023-01-12 12:01:01 +01:00
parent 7fcf4b1077
commit 076abdef71
8 changed files with 115 additions and 66 deletions

View file

@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"io"
"log"
"os"
"path/filepath"
"sort"
@ -43,7 +42,7 @@ type accessLists struct {
func newAccessLists(pki *pki, errorKernel *errorKernel, configuration *Configuration) *accessLists {
a := accessLists{
schemaMain: newSchemaMain(configuration),
schemaMain: newSchemaMain(configuration, errorKernel),
schemaGenerated: newSchemaGenerated(),
errorKernel: errorKernel,
configuration: configuration,
@ -65,21 +64,25 @@ type schemaMain struct {
NodeGroupMap map[nodeGroup]map[Node]struct{}
CommandGroupMap map[commandGroup]map[command]struct{}
mu sync.Mutex
configuration *Configuration
errorKernel *errorKernel
}
func newSchemaMain(configuration *Configuration) *schemaMain {
func newSchemaMain(configuration *Configuration, errorKernel *errorKernel) *schemaMain {
s := schemaMain{
ACLMap: make(map[Node]map[Node]map[command]struct{}),
ACLMapFilePath: filepath.Join(configuration.DatabaseFolder, "central_aclmap.txt"),
NodeGroupMap: make(map[nodeGroup]map[Node]struct{}),
CommandGroupMap: make(map[commandGroup]map[command]struct{}),
configuration: configuration,
errorKernel: errorKernel,
}
// Load ACLMap from disk if present.
func() {
if _, err := os.Stat(s.ACLMapFilePath); os.IsNotExist(err) {
er := fmt.Errorf("error: newSchemaMain: no file for ACLMap found %v: %v", s.ACLMapFilePath, err)
log.Printf("%v\n", er)
er := fmt.Errorf("info: newSchemaMain: no file for ACLMap found, will create new one, %v: %v", s.ACLMapFilePath, err)
errorKernel.logInfo(er, configuration)
// If no aclmap is present on disk we just return from this
// function without loading any values.
@ -89,20 +92,20 @@ func newSchemaMain(configuration *Configuration) *schemaMain {
fh, err := os.Open(s.ACLMapFilePath)
if err != nil {
er := fmt.Errorf("error: newSchemaMain: failed to open file for reading %v: %v", s.ACLMapFilePath, err)
log.Printf("%v\n", er)
errorKernel.logError(er, configuration)
}
b, err := io.ReadAll(fh)
if err != nil {
er := fmt.Errorf("error: newSchemaMain: failed to ReadAll file %v: %v", s.ACLMapFilePath, err)
log.Printf("%v\n", er)
errorKernel.logError(er, configuration)
}
// Unmarshal the data read from disk.
err = json.Unmarshal(b, &s.ACLMap)
if err != nil {
er := fmt.Errorf("error: newSchemaMain: failed to unmarshal content from file %v: %v", s.ACLMapFilePath, err)
log.Printf("%v\n", er)
errorKernel.logError(er, configuration)
}
// Generate the aclGenerated map happens in the function where this function is called.
@ -222,7 +225,7 @@ func (c *centralAuth) aclAddCommand(host Node, source Node, cmd command) {
err := c.generateACLsForAllNodes()
if err != nil {
er := fmt.Errorf("error: addCommandForFromNode: %v", err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
}
// fmt.Printf(" * DEBUG: aclNodeFromnodeCommandAdd: a.schemaMain.ACLMap=%v\n", a.schemaMain.ACLMap)
@ -252,7 +255,7 @@ func (c *centralAuth) aclDeleteCommand(host Node, source Node, cmd command) erro
err := c.generateACLsForAllNodes()
if err != nil {
er := fmt.Errorf("error: aclNodeFromNodeCommandDelete: %v", err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
}
return nil
@ -277,7 +280,7 @@ func (c *centralAuth) aclDeleteSource(host Node, source Node) error {
err := c.generateACLsForAllNodes()
if err != nil {
er := fmt.Errorf("error: aclNodeFromnodeDelete: %v", err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
}
return nil
@ -296,7 +299,7 @@ func (c *centralAuth) generateACLsForAllNodes() error {
fh, err := os.OpenFile(c.accessLists.schemaMain.ACLMapFilePath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0660)
if err != nil {
er := fmt.Errorf("error: generateACLsForAllNodes: opening file for writing: %v, err: %v", c.accessLists.schemaMain.ACLMapFilePath, err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
return
}
defer fh.Close()
@ -308,7 +311,7 @@ func (c *centralAuth) generateACLsForAllNodes() error {
enc.Encode(c.accessLists.schemaMain.ACLMap)
if err != nil {
er := fmt.Errorf("error: generateACLsForAllNodes: encoding json to file failed: %v, err: %v", c.accessLists.schemaMain.ACLMapFilePath, err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
return
}
}()
@ -352,7 +355,7 @@ func (c *centralAuth) generateACLsForAllNodes() error {
cb, err := cbor.Marshal(m)
if err != nil {
er := fmt.Errorf("error: generateACLsForAllNodes: failed to generate cbor for host in schemaGenerated: %v", err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
os.Exit(1)
}
@ -362,8 +365,8 @@ func (c *centralAuth) generateACLsForAllNodes() error {
b, err := cbor.Marshal(sns)
if err != nil {
err := fmt.Errorf("error: generateACLsForAllNodes: failed to generate cbor for hash: %v", err)
log.Printf("%v\n", err)
er := fmt.Errorf("error: generateACLsForAllNodes: failed to generate cbor for hash: %v", err)
c.errorKernel.logError(er, c.configuration)
return [32]byte{}
}
@ -452,7 +455,8 @@ func (c *centralAuth) groupNodesAddNode(ng nodeGroup, n Node) {
//}
if !strings.HasPrefix(string(ng), "grp_nodes_") {
log.Printf("error: group name do not start with grp_nodes_\n")
er := fmt.Errorf("error: group name do not start with grp_nodes_")
c.errorKernel.logError(er, c.configuration)
return
}
@ -469,7 +473,7 @@ func (c *centralAuth) groupNodesAddNode(ng nodeGroup, n Node) {
err := c.generateACLsForAllNodes()
if err != nil {
er := fmt.Errorf("error: groupNodesAddNode: %v", err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
}
}
@ -479,7 +483,8 @@ func (c *centralAuth) groupNodesDeleteNode(ng nodeGroup, n Node) {
c.accessLists.schemaMain.mu.Lock()
defer c.accessLists.schemaMain.mu.Unlock()
if _, ok := c.accessLists.schemaMain.NodeGroupMap[ng][n]; !ok {
log.Printf("info: no such node with name=%v found in group=%v\n", ng, n)
er := fmt.Errorf("info: no such node with name=%v found in group=%v", ng, n)
c.errorKernel.logError(er, c.configuration)
return
}
@ -490,7 +495,7 @@ func (c *centralAuth) groupNodesDeleteNode(ng nodeGroup, n Node) {
err := c.generateACLsForAllNodes()
if err != nil {
er := fmt.Errorf("error: groupNodesDeleteNode: %v", err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
}
}
@ -500,7 +505,8 @@ func (c *centralAuth) groupNodesDeleteGroup(ng nodeGroup) {
c.accessLists.schemaMain.mu.Lock()
defer c.accessLists.schemaMain.mu.Unlock()
if _, ok := c.accessLists.schemaMain.NodeGroupMap[ng]; !ok {
log.Printf("info: no such group found: %v\n", ng)
er := fmt.Errorf("info: no such group found: %v", ng)
c.errorKernel.logError(er, c.configuration)
return
}
@ -511,7 +517,7 @@ func (c *centralAuth) groupNodesDeleteGroup(ng nodeGroup) {
err := c.generateACLsForAllNodes()
if err != nil {
er := fmt.Errorf("error: groupNodesDeleteGroup: %v", err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
}
}
@ -528,7 +534,8 @@ func (c *centralAuth) groupCommandsAddCommand(cg commandGroup, cmd command) {
// }
if !strings.HasPrefix(string(cg), "grp_commands_") {
log.Printf("error: group name do not start with grp_commands_\n")
er := fmt.Errorf("error: group name do not start with grp_commands_")
c.errorKernel.logError(er, c.configuration)
return
}
@ -545,7 +552,7 @@ func (c *centralAuth) groupCommandsAddCommand(cg commandGroup, cmd command) {
err := c.generateACLsForAllNodes()
if err != nil {
er := fmt.Errorf("error: groupCommandsAddCommand: %v", err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
}
}
@ -555,7 +562,8 @@ func (c *centralAuth) groupCommandsDeleteCommand(cg commandGroup, cmd command) {
c.accessLists.schemaMain.mu.Lock()
defer c.accessLists.schemaMain.mu.Unlock()
if _, ok := c.accessLists.schemaMain.CommandGroupMap[cg][cmd]; !ok {
log.Printf("info: no such command with name=%v found in group=%v\n", c, cg)
er := fmt.Errorf("info: no such command with name=%v found in group=%v", c, cg)
c.errorKernel.logError(er, c.configuration)
return
}
@ -566,7 +574,7 @@ func (c *centralAuth) groupCommandsDeleteCommand(cg commandGroup, cmd command) {
err := c.generateACLsForAllNodes()
if err != nil {
er := fmt.Errorf("error: groupCommandsDeleteCommand: %v", err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
}
}
@ -576,7 +584,8 @@ func (c *centralAuth) groupCommandDeleteGroup(cg commandGroup) {
c.accessLists.schemaMain.mu.Lock()
defer c.accessLists.schemaMain.mu.Unlock()
if _, ok := c.accessLists.schemaMain.CommandGroupMap[cg]; !ok {
log.Printf("info: no such group found: %v\n", cg)
er := fmt.Errorf("info: no such group found: %v", cg)
c.errorKernel.logError(er, c.configuration)
return
}
@ -587,7 +596,7 @@ func (c *centralAuth) groupCommandDeleteGroup(cg commandGroup) {
err := c.generateACLsForAllNodes()
if err != nil {
er := fmt.Errorf("error: groupCommandDeleteGroup: %v", err)
log.Printf("%v\n", er)
c.errorKernel.logError(er, c.configuration)
}
}

View file

@ -18,12 +18,17 @@ type centralAuth struct {
// acl and authorization level related data and methods.
accessLists *accessLists
// public key distribution related data and methods.
pki *pki
pki *pki
configuration *Configuration
errorKernel *errorKernel
}
// newCentralAuth will return a new and prepared *centralAuth
func newCentralAuth(configuration *Configuration, errorKernel *errorKernel) *centralAuth {
c := centralAuth{}
c := centralAuth{
configuration: configuration,
errorKernel: errorKernel,
}
c.pki = newPKI(configuration, errorKernel)
c.accessLists = newAccessLists(c.pki, errorKernel, configuration)
@ -290,8 +295,7 @@ func (c *centralAuth) updateHash(proc process, message Message) {
b, err := cbor.Marshal(sortedNodesAndKeys)
if err != nil {
er := fmt.Errorf("error: methodREQKeysAllow, failed to marshal slice, and will not update hash for public keys: %v", err)
c.pki.errorKernel.errSend(proc, message, er, logWarning)
log.Printf(" * DEBUG: %v\n", er)
c.pki.errorKernel.errSend(proc, message, er, logError)
return
}
@ -304,8 +308,7 @@ func (c *centralAuth) updateHash(proc process, message Message) {
c.pki.dbUpdateHash(hash[:])
if err != nil {
er := fmt.Errorf("error: methodREQKeysAllow, failed to store the hash into the db: %v", err)
c.pki.errorKernel.errSend(proc, message, er, logWarning)
log.Printf(" * DEBUG: %v\n", er)
c.pki.errorKernel.errSend(proc, message, er, logError)
return
}
@ -320,13 +323,15 @@ func (p *pki) dbViewHash() ([]byte, error) {
//Open a bucket to get key's and values from.
bu := tx.Bucket([]byte("hash"))
if bu == nil {
log.Printf("info: no db hash bucket exist\n")
er := fmt.Errorf("info: no db hash bucket exist")
p.errorKernel.logWarn(er, p.configuration)
return nil
}
v := bu.Get([]byte("hash"))
if len(v) == 0 {
log.Printf("info: view: hash key not found\n")
er := fmt.Errorf("info: view: hash key not found")
p.errorKernel.logWarn(er, p.configuration)
return nil
}

View file

@ -270,6 +270,24 @@ func (e *errorKernel) infoSend(proc process, msg Message, err error) {
e.errorCh <- ev
}
func (e *errorKernel) logError(err error, c *Configuration) {
if c.LogLevel == string(logError) {
slog.Error("error", err)
}
}
func (e *errorKernel) logInfo(err error, c *Configuration) {
if c.LogLevel == string(logInfo) {
slog.Info(err.Error())
}
}
func (e *errorKernel) logWarn(err error, c *Configuration) {
if c.LogLevel == string(logWarning) {
slog.Warn(err.Error())
}
}
func (e *errorKernel) logConsoleOnlyIfDebug(err error, c *Configuration) {
if c.LogLevel == string(logDebug) {
slog.Debug(err.Error())

View file

@ -132,7 +132,7 @@ func newSubject(method Method, node string) Subject {
mh, ok := ma.CheckIfExists(method)
//mh, ok := ma.Methodhandlers[method]
if !ok {
log.Printf("error: no Event type specified for the method: %v\n", method)
log.Printf("error: newSubject: no Event type specified for the method: %v\n", method)
os.Exit(1)
}

View file

@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
"log"
"net"
"net/http"
"os"
@ -39,11 +38,13 @@ func (s *server) readStartupFolder() {
}
for _, fp := range filePaths {
log.Printf("info: ranging filepaths, current filePath contains: %v\n", fp)
er := fmt.Errorf("info: ranging filepaths, current filePath contains: %v", fp)
s.errorKernel.logInfo(er, s.configuration)
}
for _, filePath := range filePaths {
log.Printf("info: reading and working on file from startup folder %v\n", filePath)
er := fmt.Errorf("info: reading and working on file from startup folder %v", filePath)
s.errorKernel.logInfo(er, s.configuration)
// Read the content of each file.
readBytes, err := func(filePath string) ([]byte, error) {
@ -211,14 +212,15 @@ func (s *server) readFolder() {
err := os.MkdirAll(s.configuration.ReadFolder, 0770)
if err != nil {
er := fmt.Errorf("error: failed to create readfolder folder: %v", err)
log.Printf("%v\n", er)
s.errorKernel.logError(er, s.configuration)
os.Exit(1)
}
}
watcher, err := fsnotify.NewWatcher()
if err != nil {
log.Printf("main: failed to create new logWatcher: %v\n", err)
er := fmt.Errorf("main: failed to create new logWatcher: %v", err)
s.errorKernel.logError(er, s.configuration)
os.Exit(1)
}
@ -301,7 +303,8 @@ func (s *server) readFolder() {
// Add a path.
err = watcher.Add(s.configuration.ReadFolder)
if err != nil {
log.Printf("startLogsWatcher: failed to add watcher: %v\n", err)
er := fmt.Errorf("startLogsWatcher: failed to add watcher: %v", err)
s.errorKernel.logError(er, s.configuration)
os.Exit(1)
}
}
@ -313,7 +316,8 @@ func (s *server) readFolder() {
func (s *server) readTCPListener() {
ln, err := net.Listen("tcp", s.configuration.TCPListener)
if err != nil {
log.Printf("error: readTCPListener: failed to start tcp listener: %v\n", err)
er := fmt.Errorf("error: readTCPListener: failed to start tcp listener: %v", err)
s.errorKernel.logError(er, s.configuration)
os.Exit(1)
}
// Loop, and wait for new connections.
@ -417,7 +421,8 @@ func (s *server) readHttpListener() {
go func() {
n, err := net.Listen("tcp", s.configuration.HTTPListener)
if err != nil {
log.Printf("error: startMetrics: failed to open prometheus listen port: %v\n", err)
er := fmt.Errorf("error: startMetrics: failed to open prometheus listen port: %v", err)
s.errorKernel.logError(er, s.configuration)
os.Exit(1)
}
mux := http.NewServeMux()
@ -425,7 +430,8 @@ func (s *server) readHttpListener() {
err = http.Serve(n, mux)
if err != nil {
log.Printf("error: startMetrics: failed to start http.Serve: %v\n", err)
er := fmt.Errorf("error: startMetrics: failed to start http.Serve: %v", err)
s.errorKernel.logError(er, s.configuration)
os.Exit(1)
}
}()

View file

@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"io"
"log"
"os"
"path/filepath"
"strings"
@ -55,7 +54,8 @@ func newNodeAuth(configuration *Configuration, errorKernel *errorKernel) *nodeAu
err := n.loadSigningKeys()
if err != nil {
log.Printf("%v\n", err)
er := fmt.Errorf("newNodeAuth: %v", err)
errorKernel.logError(er, configuration)
os.Exit(1)
}
@ -96,7 +96,8 @@ func newNodeAcl(c *Configuration, errorKernel *errorKernel) *nodeAcl {
err := n.loadFromFile()
if err != nil {
log.Printf("error: loading acl's from file: %v\n", err)
er := fmt.Errorf("error: newNodeAcl: loading acl's from file: %v", err)
errorKernel.logError(er, c)
// os.Exit(1)
}
@ -201,7 +202,8 @@ func newPublicKeys(c *Configuration, errorKernel *errorKernel) *publicKeys {
err := p.loadFromFile()
if err != nil {
log.Printf("error: loading public keys from file: %v\n", err)
er := fmt.Errorf("error: newPublicKeys: loading public keys from file: %v", err)
errorKernel.logError(er, c)
// os.Exit(1)
}
@ -215,7 +217,8 @@ func (p *publicKeys) loadFromFile() error {
if _, err := os.Stat(p.filePath); os.IsNotExist(err) {
// Just logging the error since it is not crucial that a key file is missing,
// since a new one will be created on the next update.
log.Printf("no public keys file found at %v\n", p.filePath)
er := fmt.Errorf("no public keys file found at %v, new file will be created", p.filePath)
p.errorKernel.logInfo(er, p.configuration)
return nil
}
@ -319,7 +322,7 @@ func (n *nodeAuth) loadSigningKeys() error {
n.SignPrivateKey = priv
er := fmt.Errorf("info: no signing keys found, generating new keys")
log.Printf("%v\n", er)
n.errorKernel.logInfo(er, n.configuration)
// We got the new generated keys now, so we can return.
return nil
@ -390,7 +393,8 @@ func (n *nodeAuth) readKeyFile(keyFile string) (ed2519key []byte, b64Key []byte,
func (n *nodeAuth) verifySignature(m Message) bool {
// NB: Only enable signature checking for REQCliCommand for now.
if m.Method != REQCliCommand {
log.Printf(" * DEBUG: verifySignature,not REQCliCommand and will not do signature check, method: %v\n", m.Method)
er := fmt.Errorf("verifySignature: not REQCliCommand and will not do signature check, method: %v", m.Method)
n.errorKernel.logInfo(er, n.configuration)
return true
}
@ -402,7 +406,7 @@ func (n *nodeAuth) verifySignature(m Message) bool {
n.publicKeys.mu.Lock()
pubKey := n.publicKeys.keysAndHash.Keys[m.FromNode]
if len(pubKey) != 32 {
err := fmt.Errorf("DEBUG: Length of publicKey: %v", len(pubKey))
err := fmt.Errorf("length of publicKey not equal to 32: %v", len(pubKey))
return err
}
@ -413,10 +417,11 @@ func (n *nodeAuth) verifySignature(m Message) bool {
}()
if err != nil {
log.Printf("%v\n", err)
n.errorKernel.logError(err, n.configuration)
}
log.Printf("info: verifySignature, result: %v, fromNode: %v, method: %v\n", ok, m.FromNode, m.Method)
er := fmt.Errorf("info: verifySignature, result: %v, fromNode: %v, method: %v", ok, m.FromNode, m.Method)
n.errorKernel.logInfo(er, n.configuration)
return ok
}
@ -425,7 +430,8 @@ func (n *nodeAuth) verifySignature(m Message) bool {
func (n *nodeAuth) verifyAcl(m Message) bool {
// NB: Only enable acl checking for REQCliCommand for now.
if m.Method != REQCliCommand {
log.Printf(" * DEBUG: verifyAcl: not REQCliCommand and will not do acl check, method: %v\n", m.Method)
er := fmt.Errorf("verifyAcl: not REQCliCommand and will not do acl check, method: %v", m.Method)
n.errorKernel.logInfo(er, n.configuration)
return true
}
@ -437,23 +443,27 @@ func (n *nodeAuth) verifyAcl(m Message) bool {
cmdMap, ok := n.nodeAcl.aclAndHash.Acl[m.FromNode]
if !ok {
log.Printf(" * DEBUG: verifyAcl: The fromNode=%v was not found in the acl\n", m.FromNode)
er := fmt.Errorf("verifyAcl: The fromNode=%v was not found in the acl", m.FromNode)
n.errorKernel.logError(er, n.configuration)
return false
}
_, ok = cmdMap[command("*")]
if ok {
log.Printf(" * DEBUG: verifyAcl: The acl said \"*\", all commands allowed from node=%v\n", m.FromNode)
er := fmt.Errorf("verifyAcl: The acl said \"*\", all commands allowed from node=%v", m.FromNode)
n.errorKernel.logInfo(er, n.configuration)
return true
}
_, ok = cmdMap[command(argsStringified)]
if !ok {
log.Printf(" * DEBUG: verifyAcl: The command=%v was NOT FOUND in the acl\n", m.MethodArgs)
er := fmt.Errorf("verifyAcl: The command=%v was NOT FOUND in the acl", m.MethodArgs)
n.errorKernel.logInfo(er, n.configuration)
return false
}
log.Printf(" * DEBUG: The command was FOUND in the acl, verifyAcl, result: %v, fromNode: %v, method: %v\n", ok, m.FromNode, m.Method)
er := fmt.Errorf("verifyAcl: the command was FOUND in the acl, verifyAcl, result: %v, fromNode: %v, method: %v", ok, m.FromNode, m.Method)
n.errorKernel.logInfo(er, n.configuration)
return true
}

View file

@ -9,7 +9,6 @@ import (
"errors"
"fmt"
"io"
"log"
"os"
"sync"
"time"
@ -822,7 +821,8 @@ func (p process) publishMessages(natsConn *nats.Conn) {
// enc, err := zstd.NewWriter(nil, zstd.WithEncoderLevel(zstd.SpeedBestCompression))
enc, err := zstd.NewWriter(nil, zstd.WithEncoderConcurrency(1))
if err != nil {
log.Printf("error: zstd new encoder failed: %v\n", err)
er := fmt.Errorf("error: zstd new encoder failed: %v", err)
p.errorKernel.logError(er, p.configuration)
os.Exit(1)
}
zEnc = enc

View file

@ -6,7 +6,6 @@ import (
"fmt"
"io"
"io/fs"
"log"
"os"
"path/filepath"
"sort"
@ -157,7 +156,8 @@ func (m methodREQCopySrc) handler(proc process, message Message, node string) ([
var err error
folderPermission, err = strconv.ParseUint(message.MethodArgs[5], 8, 32)
if err != nil {
log.Printf("%v\n", err)
er := fmt.Errorf("methodREQCopySrc: failed to parse uint, %v", err)
proc.errorKernel.logError(er, proc.configuration)
}
er := fmt.Errorf("info: FolderPermission defined in message for socket: %v, converted = %v", message.MethodArgs[5], folderPermission)
@ -348,7 +348,8 @@ func (m methodREQCopyDst) handler(proc process, message Message, node string) ([
proc.processes.active.mu.Unlock()
if ok {
log.Printf(" * * * DEBUG: subprocesses already existed, will not start another subscriber for %v\n", pn)
er := fmt.Errorf("methodREQCopyDst: subprocesses already existed, will not start another subscriber for %v", pn)
proc.errorKernel.logConsoleOnlyIfDebug(er, proc.configuration)
// HERE!!!
// If the process name already existed we return here before any