diff options
author | Philip Knirsch <pknirsch@hamburg.stuttgart.redhat.com> | 2009-02-25 11:45:48 +0100 |
---|---|---|
committer | Philip Knirsch <pknirsch@hamburg.stuttgart.redhat.com> | 2009-02-25 11:45:48 +0100 |
commit | ca552606191920c1f6d02c28b80273d2e9d4349a (patch) | |
tree | 33d7eda5f5b7ffe1d842a2c9395ea2a03650d01a /tuned | |
parent | 1fa57228447abc46d58bcc377ab373c026ccd008 (diff) | |
download | tuned-ca552606191920c1f6d02c28b80273d2e9d4349a.tar.gz tuned-ca552606191920c1f6d02c28b80273d2e9d4349a.tar.xz tuned-ca552606191920c1f6d02c28b80273d2e9d4349a.zip |
- Added complete cleanup code in case of tuned exiting and/or
getting a SIGTERM to restore default values
- Made the disk tuning pluging less nosy if started as non-daemon
- Fixed missing self. in the tuned.py config handling
Diffstat (limited to 'tuned')
-rwxr-xr-x | tuned | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -20,11 +20,14 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -import sys, os.path, getopt +import sys, os.path, getopt, atexit, signal def usage(): print "Usage: tuned [-d|--daemon] [-c conffile|--config=conffile]" +def handler(signum, frame): + sys.exit() + def daemonize(): try: pid = os.fork() @@ -76,6 +79,9 @@ if __name__ == "__main__": from tuned import tuned + atexit.register(tuned.cleanup) + signal.signal(signal.SIGTERM, handler) + tuned.init(TUNEDDIR, cfgfile) tuned.run() tuned.cleanup() |