1
0
Fork 0

Fix commands server and off.

This commit is contained in:
Marcela Mašláňová 2009-07-28 13:10:55 +02:00
parent 9490bc08b3
commit 27a8af70ef
3 changed files with 13 additions and 11 deletions

View file

@ -11,8 +11,8 @@ DIRS = doc contrib tuningplugins monitorplugins commands
FILES = tuned tuned.spec Makefile tuned.py tuned.initscript tuned.conf tuned-adm
FILES_doc = doc/DESIGN.txt doc/README.utils doc/TIPS.txt doc/tuned.8 doc/tuned.conf.5 doc/README.scomes
FILES_contrib = contrib/diskdevstat contrib/netdevstat contrib/scomes contrib/varnetload
FILES_tuningplugins = tuningplugins/cpu.py tuningplugins/disk.py tuningplugins/net.py tuningplugins/__init__.py
FILES_monitorplugins = monitorplugins/cpu.py monitorplugins/disk.py monitorplugins/net.py monitorplugins/__init__.py
FILES_tuningplugins = tuningplugins/disk.py tuningplugins/net.py tuningplugins/__init__.py
FILES_monitorplugins = monitorplugins/disk.py monitorplugins/net.py monitorplugins/__init__.py
FILES_commands = commands/cmd_default_mode.py commands/cmd_server_mode.py commands/cmd_off_mode.py commands/__init__.py
DOCS = AUTHORS ChangeLog COPYING INSTALL NEWS README

View file

@ -21,13 +21,12 @@ class Off(Command):
def run(self, *args, **kwargs):
if os.path.exists("/etc/tune.d/*.conf"):
os.remove("/etc/tune.d/*.conf")
if os.path.exists("/etc/tune.d/*.sh"):
os.remove("/etc/tune.d/*.sh")
os.system("rm -rf /etc/ktune.d/{server,laptop}.conf")
os.system("rm -rf /etc/ktune.d/{server,laptop}.sh")
if os.path.exists("/etc/sysconfig/ktune.bckp"):
os.system('mv /etc/sysconfig/ktune.bckp /etc/sysconfig/ktune')
os.remove("/etc/sysconfig/ktune")
os.rename("/etc/sysconfig/ktune.bckp", "/etc/sysconfig/ktune")
if os.path.exists("/etc/tuned.conf.bckp") and os.path.exists("/etc/tuned.conf"):
os.rename("/etc/tuned.conf.bckp", "/etc/tuned.conf")
os.system('service ktune stop')
os.system('service tuned stop')
os.system('chkconfig --del ktune')

View file

@ -24,12 +24,15 @@ class Server(Command):
def run(self, *args, **kwargs):
# link config files into directory which is exectued by ktune
if os.path.exists("/etc/tune-profiles/server/server.conf"):
os.symlink("/etc/tune-profiles/server/server.conf", "/etc/tune.d/server.conf")
os.symlink("/etc/tune-profiles/server/server.conf", "/etc/ktune.d/server.conf")
if os.path.exists("/etc/tune-profiles/server/server.sh"):
os.symlink("/etc/tune-profiles/server/server.sh", "/etc/tune.d/server.sh")
os.system('mv /etc/sysconfig/ktune /etc/sysconfig/ktune.bckp')
os.symlink("/etc/tune-profiles/server/server.sh", "/etc/ktune.d/server.sh")
if os.path.exists("/etc/tune-profiles/server/ktune"):
os.system('mv /etc/sysconfig/ktune /etc/sysconfig/ktune.bckp')
os.symlink("/etc/tune-profiles/server/ktune", "/etc/sysconfig/ktune")
if os.path.exists("/etc/tune-profiles/server/tuned.conf"):
os.system("mv /etc/tuned.conf /etc/tuned.conf.bckp")
os.symlink("/etc/tune-profiles/server/tuned.conf", "/etc/tuned.conf")
os.system('service ktune start')
os.system('chkconfig --add ktune && chkconfig --level 345 ktune on')