diff --git a/CHANGELOG.md b/CHANGELOG.md index 10637794..d4fc3acf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Added `wwctl overlay import --overwrite` to overwrite existing overlay file. +- wwclient uses `WW_IPADDR`, if set, to contact the Warewulf server. #1788 ### Fixed diff --git a/internal/app/wwclient/root.go b/internal/app/wwclient/root.go index 4530b754..24cf04ff 100644 --- a/internal/app/wwclient/root.go +++ b/internal/app/wwclient/root.go @@ -193,8 +193,12 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) { } }() var finishedInitialSync bool = false + ipaddr := os.Getenv("WW_IPADDR") + if ipaddr == "" { + ipaddr = conf.Ipaddr + } for { - updateSystem(conf.Ipaddr, conf.Warewulf.Port, wwid, tag, localUUID) + updateSystem(ipaddr, conf.Warewulf.Port, wwid, tag, localUUID) if !finishedInitialSync { // ignore error and status here, as this wouldn't change anything _, _ = daemon.SdNotify(false, daemon.SdNotifyReady) diff --git a/overlays/wwclient/internal/wwclient_test.go b/overlays/wwclient/internal/wwclient_test.go index 328a7634..34871d2b 100644 --- a/overlays/wwclient/internal/wwclient_test.go +++ b/overlays/wwclient/internal/wwclient_test.go @@ -57,5 +57,6 @@ Filename: warewulf/init.d/80-wwclient # Only start if the systemd is not available test -e /usr/lib/systemd/systemd && exit 0 echo "Starting wwclient" +if [ -r /etc/default/wwclient ]; then . /etc/default/wwclient; fi nohup /warewulf/wwclient >/var/log/wwclient.log 2>&1 /var/log/wwclient.log 2>&1