Skip to content

Commit 107e0cf

Browse files
committed
18901: FIX Reenable rrdcached daemon pausing during online backups
SUP-27728 Regression introduced in "Enable bandit check B108 (hardcoded_tmp_directory)" in the change with ID: I0102461e41a84caa9726bb3e743f82caf9c8d3d8 Change-Id: Ib77fcfaf0d0a3fe98332ac0b6fefc22bbc305937
1 parent 6245a5b commit 107e0cf

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

.werks/18901.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[//]: # (werk v3)
2+
# Reenable rrdcached daemon pausing during online backups
3+
4+
key | value
5+
---------- | ---
6+
date | 2026-04-09T08:57:01.899842+00:00
7+
version | 2.5.0b4
8+
class | fix
9+
edition | community
10+
component | omd
11+
level | 1
12+
compatible | yes
13+
14+
During online backups, the backup process is supposed to pause the rrdcached
15+
daemon while copying RRD files. Due to an incorrect socket path introduced in
16+
2.3.0b1, this pausing was not working, and the backup script logged an error
17+
accordingly.
18+
19+
This has been fixed by correcting the socket path.

omd/packages/omd/omdlib/backup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def accepted_files(tarinfo: tarfile.TarInfo) -> bool:
157157
for glob_pattern in excludes
158158
)
159159

160-
with _RRDSocket(site_is_stopped, site_name, verbose) as rrd_socket:
160+
with _RRDSocket(site_is_stopped, site_home, site_name, verbose) as rrd_socket:
161161
# Add the version symlink as first file to be able to
162162
# check a) the sitename and b) the version before reading
163163
# the whole tar archive. Important for streaming.
@@ -235,8 +235,8 @@ def get_exclude_patterns(options: BackupExclusions) -> list[str]:
235235

236236

237237
class _RRDSocket(contextlib.AbstractContextManager["_RRDSocket"]):
238-
def __init__(self, site_stopped: bool, site_name: str, verbose: bool) -> None:
239-
self._rrdcached_socket_path = str(Path("site_dir") / "tmp/run/rrdcached.sock")
238+
def __init__(self, site_stopped: bool, site_home: str, site_name: str, verbose: bool) -> None:
239+
self._rrdcached_socket_path = Path(site_home, "tmp/run/rrdcached.sock") # nosec B108 # not system /tmp; site_home is owned by the site user
240240
self._site_requires_suspension = not site_stopped and os.path.exists(
241241
self._rrdcached_socket_path
242242
)
@@ -292,7 +292,7 @@ def _send_rrdcached_command(self, cmd: str) -> None:
292292
if self._sock is None:
293293
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
294294
try:
295-
sock.connect(self._rrdcached_socket_path)
295+
sock.connect(os.fspath(self._rrdcached_socket_path))
296296
except OSError as e:
297297
if self._verbose:
298298
sys.stdout.write("skipping rrdcached command (%s)\n" % e)

0 commit comments

Comments
 (0)