aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Arapov <anton@redhat.com>2010-10-20 12:49:23 +0200
committerEric B Munson <emunson@mgebm.net>2010-10-20 10:49:29 -0500
commit469aaa9be42e8866d7e1527b6f4c5430db4fb38f (patch)
tree173b351d6d45fd4be650e09c969d3e0e0469b6ba
parent1f07d1dd1d4b494e03de26e9af9945ad7a654e78 (diff)
downloadlibhugetlbfs-469aaa9be42e8866d7e1527b6f4c5430db4fb38f.tar.gz
setup_helper: check for permission and disable default debug mode
1. fallback gracefully with explanation; 2. do actual work; not just print out; // *debug*mode* off. Signed-off-by: Anton Arapov <anton@redhat.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
-rwxr-xr-xhuge_page_setup_helper.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/huge_page_setup_helper.py b/huge_page_setup_helper.py
index b8545ed..9de0739 100755
--- a/huge_page_setup_helper.py
+++ b/huge_page_setup_helper.py
@@ -10,7 +10,12 @@
#
import os
-debug = True
+debug = False
+
+# must be executed under the root to operate
+if os.geteuid() != 0:
+ print "You must be root to setup hugepages!"
+ os._exit(1)
# config files we need access to
sysctlConf = "/etc/sysctl.conf"