-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When removing netdata and netdata-ui packages together (same yum transaction), the netdata service is restarted by the ui package then stopped immediately after by the removal the netdata package. This could make the service to hang and leave it in a failed state and not entirely removed. This patch adds a delay of 3 seconds before killing the main netdata process. This gives enough time to netdata to start before being stopped. Signed-off-by: Thierry Escande <[email protected]>
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
SOURCES/netdata-v2.1.0-handle-systemd-unit-stop.XCP-ng.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/system/systemd/netdata.service.v235.in b/system/systemd/netdata.service.v235.in | ||
index 3d52677..055406d 100644 | ||
--- a/system/systemd/netdata.service.v235.in | ||
+++ b/system/systemd/netdata.service.v235.in | ||
@@ -13,6 +13,10 @@ EnvironmentFile=-/etc/default/netdata | ||
ExecStart=@sbindir_POST@/netdata -D $EXTRA_OPTS | ||
# XCP-ng: call script that will load /etc/sysconfig/iptables_netdata if it exists | ||
ExecStartPre=/usr/libexec/netdata/xcpng-iptables-restore.sh | ||
+# XCP-ng: Add a delay before stopping netdata to avoid the service to hang and | ||
+# be in a failed state if stop is called too soon after a start. | ||
+ExecStop=/usr/bin/sleep 3 | ||
+ExecStop=/usr/bin/kill --signal SIGTERM $MAINPID | ||
|
||
# saving a big db on slow disks may need some time | ||
TimeoutStopSec=150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,7 @@ Patch10: netdata-remove-fonts-2.0.0.patch | |
# XCP-ng specific patches | ||
Patch1000: netdata-v2.1.0-fix-gcc4-static-struct-init.XCP-ng.patch | ||
Patch1001: netdata-v2.1.0-firewall-management-in-systemd-unit.XCP-ng.patch | ||
Patch1002: netdata-v2.1.0-handle-systemd-unit-stop.XCP-ng.patch | ||
|
||
BuildRequires: zlib-devel | ||
BuildRequires: git | ||
|
@@ -293,6 +294,7 @@ if [ -d src/web/gui/v2 ] ; then | |
fi | ||
%patch -P1000 -p1 | ||
%patch -P1001 -p1 | ||
%patch -P1002 -p1 | ||
cp %{SOURCE5} . | ||
|
||
### BEGIN go.d.plugin | ||
|
@@ -598,6 +600,7 @@ fi | |
- Create netdata-ui subpackage | ||
- Add firewall rules management | ||
- Enable xenstat plugin | ||
- Handle service ExecStop to avoid service to hang when removing packages | ||
- *** Upstream changelog *** | ||
- * Sat Dec 21 2024 Didier Fabert <[email protected]> 2.1.0-3 | ||
- - go-module cannot be built in fc40 | ||
|