From 89721c683259ada9761cacda21d36bb7a3b11171 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Wed, 5 Feb 2025 21:58:39 -0700 Subject: [PATCH 1/2] Remove `warewulf.conf:syslog` - Fixes: #1606 Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 4 ++++ docs/man/man5/warewulf.conf.5 | 9 --------- etc/warewulf.conf | 1 - internal/app/wwctl/overlay/show/main_test.go | 1 - internal/pkg/config/buildconfig.go.in | 5 ----- internal/pkg/config/root_test.go | 3 --- internal/pkg/upgrade/config.go | 4 +++- internal/pkg/upgrade/config_test.go | 5 ----- internal/pkg/warewulfd/daemon.go | 18 ------------------ overlays/debug/internal/debug_test.go | 1 - overlays/debug/rootfs/tstruct.md.ww | 1 - overlays/fstab/internal/warewulf.conf | 1 - overlays/host/internal/warewulf.conf | 1 - overlays/host/internal/warewulf.conf-static | 1 - overlays/hosts/internal/warewulf.conf | 1 - overlays/wwinit/internal/warewulf.conf | 1 - overlays/wwinit/internal/wwinit_test.go | 1 - userdocs/contents/configuration.rst | 4 ---- .../development-environment-vagrant.rst | 1 - userdocs/quickstart/debian12.rst | 1 - userdocs/quickstart/el.rst | 1 - userdocs/quickstart/suse15.rst | 1 - 22 files changed, 7 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88cac6d9..088c7842 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix a warewulfd panic when no kernel fields are specified. #1689 - Create site overlay directory. #1690 +### Removed + +- Remove `warewulf.conf:syslog`. #1606 + ## v4.6.0rc1, 2025-01-29 ### Added diff --git a/docs/man/man5/warewulf.conf.5 b/docs/man/man5/warewulf.conf.5 index e3b5e918..c9440c13 100644 --- a/docs/man/man5/warewulf.conf.5 +++ b/docs/man/man5/warewulf.conf.5 @@ -103,14 +103,6 @@ updated by \fBwwctl-configure(1)\fP. Default: true .IP -.TP -\fBsyslog\fP - -When true, Warewulf server logs are written to syslog. - -Default: false -.IP - .TP \fBdatastore\fP @@ -260,7 +252,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: false datastore: "" dhcp: enabled: true diff --git a/etc/warewulf.conf b/etc/warewulf.conf index 740b2e7b..d19c8102 100644 --- a/etc/warewulf.conf +++ b/etc/warewulf.conf @@ -5,7 +5,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: false dhcp: enabled: true range start: 10.0.1.1 diff --git a/internal/app/wwctl/overlay/show/main_test.go b/internal/app/wwctl/overlay/show/main_test.go index 34d84db5..5e098639 100644 --- a/internal/app/wwctl/overlay/show/main_test.go +++ b/internal/app/wwctl/overlay/show/main_test.go @@ -34,7 +34,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: true dhcp: enabled: true range start: 192.168.0.100 diff --git a/internal/pkg/config/buildconfig.go.in b/internal/pkg/config/buildconfig.go.in index 9b3a5859..3d105aa7 100644 --- a/internal/pkg/config/buildconfig.go.in +++ b/internal/pkg/config/buildconfig.go.in @@ -45,7 +45,6 @@ type WarewulfConf struct { UpdateInterval int `yaml:"update interval,omitempty" default:"60"` AutobuildOverlaysP *bool `yaml:"autobuild overlays,omitempty" default:"true"` EnableHostOverlayP *bool `yaml:"host overlay,omitempty" default:"true"` - SyslogP *bool `yaml:"syslog,omitempty" default:"false"` GrubBootP *bool `yaml:"grubboot,omitempty" default:"false"` } @@ -61,10 +60,6 @@ func (this WarewulfConf) EnableHostOverlay() bool { return BoolP(this.EnableHostOverlayP) } -func (this WarewulfConf) Syslog() bool { - return BoolP(this.SyslogP) -} - func (this WarewulfConf) GrubBoot() bool { return BoolP(this.GrubBootP) } diff --git a/internal/pkg/config/root_test.go b/internal/pkg/config/root_test.go index cb63a0fa..9e75b92d 100644 --- a/internal/pkg/config/root_test.go +++ b/internal/pkg/config/root_test.go @@ -15,7 +15,6 @@ func TestDefaultWarewulfYaml(t *testing.T) { assert.Equal(t, 60, conf.Warewulf.UpdateInterval) assert.True(t, conf.Warewulf.AutobuildOverlays()) assert.True(t, conf.Warewulf.EnableHostOverlay()) - assert.False(t, conf.Warewulf.Syslog()) assert.True(t, conf.DHCP.Enabled()) assert.Equal(t, "default", conf.DHCP.Template) @@ -80,7 +79,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: false dhcp: enabled: true range start: 192.168.200.50 @@ -121,7 +119,6 @@ image mounts: assert.Equal(t, 60, conf.Warewulf.UpdateInterval) assert.True(t, conf.Warewulf.AutobuildOverlays()) assert.True(t, conf.Warewulf.EnableHostOverlay()) - assert.False(t, conf.Warewulf.Syslog()) assert.True(t, conf.DHCP.Enabled()) assert.Equal(t, "192.168.200.50", conf.DHCP.RangeStart) diff --git a/internal/pkg/upgrade/config.go b/internal/pkg/upgrade/config.go index f10f8cca..a41116bd 100644 --- a/internal/pkg/upgrade/config.go +++ b/internal/pkg/upgrade/config.go @@ -106,7 +106,9 @@ func (this *WarewulfConf) Upgrade() (upgraded *config.WarewulfConf) { upgraded.UpdateInterval = this.UpdateInterval upgraded.AutobuildOverlaysP = this.AutobuildOverlays upgraded.EnableHostOverlayP = this.EnableHostOverlay - upgraded.SyslogP = this.Syslog + if this.Syslog != nil { + wwlog.Warn("syslog configuration ignored: all logs now go to stdout/stderr") + } upgraded.GrubBootP = this.GrubBoot return upgraded } diff --git a/internal/pkg/upgrade/config_test.go b/internal/pkg/upgrade/config_test.go index d15bf939..d9e5470b 100644 --- a/internal/pkg/upgrade/config_test.go +++ b/internal/pkg/upgrade/config_test.go @@ -150,7 +150,6 @@ warewulf: secure: true update interval: 60 autobuild overlays: true - syslog: false dhcp: enabled: true template: default @@ -216,7 +215,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: false dhcp: enabled: true template: default @@ -281,7 +279,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: false dhcp: enabled: true range start: 192.168.200.50 @@ -360,7 +357,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: false dhcp: enabled: true range start: 10.0.1.1 @@ -454,7 +450,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: false dhcp: enabled: true range start: 10.0.1.1 diff --git a/internal/pkg/warewulfd/daemon.go b/internal/pkg/warewulfd/daemon.go index 1a338f71..b6825300 100644 --- a/internal/pkg/warewulfd/daemon.go +++ b/internal/pkg/warewulfd/daemon.go @@ -2,7 +2,6 @@ package warewulfd import ( "fmt" - "log/syslog" "os" "os/exec" "strconv" @@ -10,7 +9,6 @@ import ( "time" "github.com/pkg/errors" - warewulfconf "github.com/warewulf/warewulf/internal/pkg/config" "github.com/warewulf/warewulf/internal/pkg/util" "github.com/warewulf/warewulf/internal/pkg/wwlog" ) @@ -55,22 +53,6 @@ func DaemonInitLogging() error { wwlog.SetLogLevel(wwlog.INFO) } - conf := warewulfconf.Get() - - if conf.Warewulf.Syslog() { - - wwlog.Debug("Changing log output to syslog") - - logwriter, err := syslog.New(syslog.LOG_NOTICE, "warewulfd") - if err != nil { - return fmt.Errorf("Could not create syslog writer: %w", err) - } - - wwlog.SetLogFormatter(wwlog.DefaultFormatter) - wwlog.SetLogWriter(logwriter) - - } - loginit = true return nil diff --git a/overlays/debug/internal/debug_test.go b/overlays/debug/internal/debug_test.go index 5c4d3da9..2b32b5ad 100644 --- a/overlays/debug/internal/debug_test.go +++ b/overlays/debug/internal/debug_test.go @@ -83,7 +83,6 @@ data from other structures. - UpdateInterval: 60 - AutobuildOverlays: true - EnableHostOverlay: true -- Syslog: false ### Network diff --git a/overlays/debug/rootfs/tstruct.md.ww b/overlays/debug/rootfs/tstruct.md.ww index d1e44593..3684dde1 100644 --- a/overlays/debug/rootfs/tstruct.md.ww +++ b/overlays/debug/rootfs/tstruct.md.ww @@ -25,7 +25,6 @@ data from other structures. - UpdateInterval: {{ .Warewulf.UpdateInterval }} - AutobuildOverlays: {{ .Warewulf.AutobuildOverlays }} - EnableHostOverlay: {{ .Warewulf.EnableHostOverlay }} -- Syslog: {{ .Warewulf.Syslog }} ### Network diff --git a/overlays/fstab/internal/warewulf.conf b/overlays/fstab/internal/warewulf.conf index fec04483..e1fb8850 100644 --- a/overlays/fstab/internal/warewulf.conf +++ b/overlays/fstab/internal/warewulf.conf @@ -7,7 +7,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: true dhcp: enabled: true range start: 192.168.0.100 diff --git a/overlays/host/internal/warewulf.conf b/overlays/host/internal/warewulf.conf index fec04483..e1fb8850 100644 --- a/overlays/host/internal/warewulf.conf +++ b/overlays/host/internal/warewulf.conf @@ -7,7 +7,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: true dhcp: enabled: true range start: 192.168.0.100 diff --git a/overlays/host/internal/warewulf.conf-static b/overlays/host/internal/warewulf.conf-static index b0eadadd..90562647 100644 --- a/overlays/host/internal/warewulf.conf-static +++ b/overlays/host/internal/warewulf.conf-static @@ -7,7 +7,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: true dhcp: enabled: true template: static diff --git a/overlays/hosts/internal/warewulf.conf b/overlays/hosts/internal/warewulf.conf index fec04483..e1fb8850 100644 --- a/overlays/hosts/internal/warewulf.conf +++ b/overlays/hosts/internal/warewulf.conf @@ -7,7 +7,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: true dhcp: enabled: true range start: 192.168.0.100 diff --git a/overlays/wwinit/internal/warewulf.conf b/overlays/wwinit/internal/warewulf.conf index fec04483..e1fb8850 100644 --- a/overlays/wwinit/internal/warewulf.conf +++ b/overlays/wwinit/internal/warewulf.conf @@ -7,7 +7,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: true dhcp: enabled: true range start: 192.168.0.100 diff --git a/overlays/wwinit/internal/wwinit_test.go b/overlays/wwinit/internal/wwinit_test.go index a09b9f14..33414571 100644 --- a/overlays/wwinit/internal/wwinit_test.go +++ b/overlays/wwinit/internal/wwinit_test.go @@ -66,7 +66,6 @@ warewulf: update interval: 60 autobuild overlays: true host overlay: true - syslog: true dhcp: enabled: true range start: 192.168.0.100 diff --git a/userdocs/contents/configuration.rst b/userdocs/contents/configuration.rst index a8a721b4..b9cfd1ed 100644 --- a/userdocs/contents/configuration.rst +++ b/userdocs/contents/configuration.rst @@ -23,7 +23,6 @@ Warewulf (4.6.0): update interval: 60 autobuild overlays: true host overlay: true - syslog: false dhcp: enabled: true range start: 10.0.1.1 @@ -111,9 +110,6 @@ explained as follows: configuration. (The host overlay is used to configure the dependent services.) -* ``warewulf:syslog``: This determines whether Warewulf server logs go - to syslog. - * ``nfs:export paths``: Warewulf can automatically set up these NFS exports. diff --git a/userdocs/contributing/development-environment-vagrant.rst b/userdocs/contributing/development-environment-vagrant.rst index 35f196af..33a4c1d8 100644 --- a/userdocs/contributing/development-environment-vagrant.rst +++ b/userdocs/contributing/development-environment-vagrant.rst @@ -199,7 +199,6 @@ Vagrantfile update interval: 60 autobuild overlays: true host overlay: true - syslog: false dhcp: enabled: true range start: 192.168.200.50 diff --git a/userdocs/quickstart/debian12.rst b/userdocs/quickstart/debian12.rst index 2a850880..a6b26be8 100644 --- a/userdocs/quickstart/debian12.rst +++ b/userdocs/quickstart/debian12.rst @@ -74,7 +74,6 @@ address of your cluster's private network interface: update interval: 60 autobuild overlays: true host overlay: true - syslog: false dhcp: enabled: true range start: 192.168.200.50 diff --git a/userdocs/quickstart/el.rst b/userdocs/quickstart/el.rst index ca124657..6c1fd87e 100644 --- a/userdocs/quickstart/el.rst +++ b/userdocs/quickstart/el.rst @@ -67,7 +67,6 @@ address of your cluster's private network interface. update interval: 60 autobuild overlays: true host overlay: true - syslog: false datastore: /usr/share grubboot: false dhcp: diff --git a/userdocs/quickstart/suse15.rst b/userdocs/quickstart/suse15.rst index c808e926..02f2d841 100644 --- a/userdocs/quickstart/suse15.rst +++ b/userdocs/quickstart/suse15.rst @@ -55,7 +55,6 @@ address of your cluster's private network interface: update interval: 60 autobuild overlays: true host overlay: true - syslog: false dhcp: enabled: true range start: 192.168.200.50 From fa46794d3803d80bd05937fbd4c73561ff436187 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Wed, 5 Feb 2025 22:14:53 -0700 Subject: [PATCH 2/2] New OPTIONS variable for warewulfd.service Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 1 + include/systemd/warewulfd.service.in | 2 +- userdocs/contents/troubleshooting.rst | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 088c7842..942688ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Document defining kernel args that include commas. #1679 - Recommend installing ipmitool with Warewulf package. #970 - Add completion for profile list. #1695 +- Add OPTIONS argument for `warewulfd.service`. #1707 ### Changed diff --git a/include/systemd/warewulfd.service.in b/include/systemd/warewulfd.service.in index 249f370a..c0f7c20f 100644 --- a/include/systemd/warewulfd.service.in +++ b/include/systemd/warewulfd.service.in @@ -9,7 +9,7 @@ Type=exec EnvironmentFile=-/etc/default/warewulfd User=root Group=root -ExecStart=@BINDIR@/wwctl server +ExecStart=@BINDIR@/wwctl server $OPTIONS ExecReload=/bin/kill -HUP "$MAINPID" Restart=always diff --git a/userdocs/contents/troubleshooting.rst b/userdocs/contents/troubleshooting.rst index ff0e0d19..a74b57cd 100644 --- a/userdocs/contents/troubleshooting.rst +++ b/userdocs/contents/troubleshooting.rst @@ -1,6 +1,23 @@ Troubleshooting =============== +warewulfd +--------- + +The Warewulf server (``warewulfd``) sends logs to the systemd journal. + +.. code-block:: + + journalctl -u warewulfd.service + +To increase the verbosity of the log, specify either ``--verbose`` or +``--debug`` in the warewulfd OPTIONS. + +.. code-block:: + + echo "OPTIONS=--debug" >>/etc/default/warewulfd + systemctl restart warewulfd.service + iPXE ----