Skip to content

Commit

Permalink
Check PID within the namespace
Browse files Browse the repository at this point in the history
PID filtering should only happen within current namespace
  • Loading branch information
grebennikov committed Oct 11, 2018
1 parent b399694 commit 040cf72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zaza/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ async def async_get_unit_service_start_time(unit_name, service,
:rtype: int
:raises: ServiceNotRunning
"""
cmd = "stat -c %Y /proc/$(pidof -x {} | cut -f1 -d ' ')".format(service)
cmd = ("stat -c %Y /proc/$(pgrep {} --nslist pid"
" --ns 1 | head -n1)").format(service)
out = await async_run_on_unit(
unit_name=unit_name,
command=cmd,
Expand Down

0 comments on commit 040cf72

Please sign in to comment.