提交 288d74f0 编写于 作者: L Lukáš Doktor

utils: Use sudo to drop caches

The write to /proc/sys/vm/drop_caches requires root, let's use the
`sudo` to allow the execution for non-root executions as well.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 15dec5ac
......@@ -147,8 +147,8 @@ def drop_caches():
"""
process.run("sync", verbose=False)
# We ignore failures here as this will fail on 2.6.11 kernels.
process.run("echo 3 > /proc/sys/vm/drop_caches", ignore_status=True,
verbose=False)
process.run("/bin/sh -c 'echo 3 > /proc/sys/vm/drop_caches'",
ignore_status=True, verbose=False, sudo=True)
def read_from_vmstat(key):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册