diff --git a/Makefile b/Makefile index bdf59094..506776ca 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ TFTPDIR ?= /var/lib/tftpboot # Warewulf directory paths VARLIST += WWCLIENTDIR WWCONFIGDIR WWPROVISIONDIR WWOVERLAYDIR WWCHROOTDIR WWTFTPDIR WWDOCDIR WWDATADIR WWCONFIGDIR := $(SYSCONFDIR)/$(WAREWULF) -WWPROVISIONDIR := $(LOCALSTATEDIR)/$(WAREWULF) +WWPROVISIONDIR := $(SRVDIR)/$(WAREWULF) WWOVERLAYDIR := $(LOCALSTATEDIR)/$(WAREWULF)/overlays WWCHROOTDIR := $(LOCALSTATEDIR)/$(WAREWULF)/chroots WWTFTPDIR := $(TFTPDIR)/$(WAREWULF) diff --git a/internal/app/wwctl/container/exec/main.go b/internal/app/wwctl/container/exec/main.go index 4d405e91..eccab4ff 100644 --- a/internal/app/wwctl/container/exec/main.go +++ b/internal/app/wwctl/container/exec/main.go @@ -78,7 +78,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { unixStat = fileStat.Sys().(*syscall.Stat_t) syncuids := false if passwdTime.Before(time.Unix(int64(unixStat.Ctim.Sec), int64(unixStat.Ctim.Nsec))) { - if NoSyncUser { + if !SyncUser { wwlog.Printf(wwlog.WARN, "/etc/passwd has been modified, maybe you want to run syncuser\n") } syncuids = true @@ -87,13 +87,13 @@ func CobraRunE(cmd *cobra.Command, args []string) error { fileStat, _ = os.Stat(path.Join(containerPath, "/etc/group")) unixStat = fileStat.Sys().(*syscall.Stat_t) if groupTime.Before(time.Unix(int64(unixStat.Ctim.Sec), int64(unixStat.Ctim.Nsec))) { - if NoSyncUser { + if !SyncUser { wwlog.Printf(wwlog.WARN, "/etc/group has been modified, maybe you want to run syncuser\n") } syncuids = true } wwlog.Printf(wwlog.DEBUG, "group: %v\n", time.Unix(int64(unixStat.Ctim.Sec), int64(unixStat.Ctim.Nsec))) - if syncuids && !NoSyncUser { + if syncuids && SyncUser { err = container.SyncUids(containerName, true) if err != nil { wwlog.Printf(wwlog.ERROR, "Error in user sync, fix error and run 'syncuser' manually, but trying to build container: %s\n", err) diff --git a/internal/app/wwctl/container/exec/root.go b/internal/app/wwctl/container/exec/root.go index 5294b591..db8bea41 100644 --- a/internal/app/wwctl/container/exec/root.go +++ b/internal/app/wwctl/container/exec/root.go @@ -25,14 +25,14 @@ var ( }, FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, } - NoSyncUser bool - binds []string + SyncUser bool + binds []string ) func init() { baseCmd.AddCommand(child.GetCommand()) baseCmd.PersistentFlags().StringArrayVarP(&binds, "bind", "b", []string{}, "Bind a local path into the container (must exist)") - baseCmd.PersistentFlags().BoolVar(&NoSyncUser, "nosyncuser", false, "Don't synchronize uis/gods from host to container") + baseCmd.PersistentFlags().BoolVar(&SyncUser, "syncuser", false, "Synchronize UIDs/GIDs from host to container") } // GetRootCommand returns the root cobra.Command for the application. diff --git a/internal/app/wwctl/node/set/main.go b/internal/app/wwctl/node/set/main.go index 6460313e..e1da70d7 100644 --- a/internal/app/wwctl/node/set/main.go +++ b/internal/app/wwctl/node/set/main.go @@ -248,7 +248,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error { } wwlog.Printf(wwlog.VERBOSE, "Node: %s:%s, Setting HW address to: %s\n", n.Id.Get(), SetNetName, SetHwaddr) - n.NetDevs[SetNetName].Hwaddr.Set(strings.ToLower(SetHwaddr)) + n.NetDevs[SetNetName].Hwaddr.Set(SetHwaddr) } if SetType != "" { diff --git a/internal/pkg/warewulfd/nodedb.go b/internal/pkg/warewulfd/nodedb.go index f5e05fe8..7ece9ea7 100644 --- a/internal/pkg/warewulfd/nodedb.go +++ b/internal/pkg/warewulfd/nodedb.go @@ -1,6 +1,7 @@ package warewulfd import ( + "strings" "sync" "github.com/pkg/errors" @@ -32,7 +33,8 @@ func LoadNodeDB() error { for _, n := range nodes { for _, netdev := range n.NetDevs { - TmpMap[netdev.Hwaddr.Get()] = n + hwaddr := strings.ToLower(netdev.Hwaddr.Get()) + TmpMap[hwaddr] = n } }