49 lines
987 B
Diff
49 lines
987 B
Diff
From 98063947dd683e89e15aebca05fc464605fe479c Mon Sep 17 00:00:00 2001
|
|
From: Thomas Woerner <twoerner@redhat.com>
|
|
Date: Fri, 22 Jan 2010 19:00:41 +0100
|
|
Subject: [PATCH] - ktune: added insufficient user rights test to start, reload, stop and status
|
|
service commands
|
|
|
|
---
|
|
ktune/ktune.init | 5 +++++
|
|
1 files changed, 5 insertions(+), 0 deletions(-)
|
|
|
|
diff --git a/ktune/ktune.init b/ktune/ktune.init
|
|
index f573b86..d5d0cb5 100644
|
|
--- a/ktune/ktune.init
|
|
+++ b/ktune/ktune.init
|
|
@@ -134,6 +134,7 @@ revert_sysctl() {
|
|
}
|
|
|
|
start() {
|
|
+ [ "$EUID" != "0" ] && exit 4
|
|
ret=0
|
|
|
|
load_sysctl
|
|
@@ -159,11 +160,13 @@ start() {
|
|
}
|
|
|
|
reload() {
|
|
+ [ "$EUID" != "0" ] && exit 4
|
|
revert_sysctl
|
|
load_sysctl
|
|
}
|
|
|
|
stop() {
|
|
+ [ "$EUID" != "0" ] && exit 4
|
|
ret=0
|
|
|
|
revert_sysctl
|
|
@@ -189,6 +192,8 @@ stop() {
|
|
}
|
|
|
|
status() {
|
|
+ [ "$EUID" != "0" ] && exit 4
|
|
+
|
|
if [ ! -f "$VAR_SUBSYS_KTUNE" ]; then
|
|
echo $"ktune settings are not applied."
|
|
return 3
|
|
--
|
|
1.6.6
|
|
|