Skip to content

Commit 040cf72

Browse files
committed
Check PID within the namespace
PID filtering should only happen within current namespace
1 parent b399694 commit 040cf72

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

zaza/model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ async def async_get_unit_service_start_time(unit_name, service,
323323
:rtype: int
324324
:raises: ServiceNotRunning
325325
"""
326-
cmd = "stat -c %Y /proc/$(pidof -x {} | cut -f1 -d ' ')".format(service)
326+
cmd = ("stat -c %Y /proc/$(pgrep {} --nslist pid"
327+
" --ns 1 | head -n1)").format(service)
327328
out = await async_run_on_unit(
328329
unit_name=unit_name,
329330
command=cmd,

0 commit comments

Comments
 (0)