rpms/system-config-kdump/devel system-config-kdump-1.0.14-error-handling.patch, NONE, 1.1 system-config-kdump.spec, 1.7, 1.8
Lubomir Rintel
lkundrak at fedoraproject.org
Mon Apr 13 19:49:28 UTC 2009
- Previous message (by thread): rpms/leonidas-backgrounds/devel .cvsignore, 1.3, 1.4 leonidas-backgrounds.spec, 1.2, 1.3 sources, 1.3, 1.4
- Next message (by thread): rpms/nautilus/devel .cvsignore, 1.94, 1.95 nautilus-2.23.5-selinux.patch, 1.2, 1.3 nautilus.spec, 1.269, 1.270 sources, 1.98, 1.99
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: lkundrak
Update of /cvs/pkgs/rpms/system-config-kdump/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv942
Modified Files:
system-config-kdump.spec
Added Files:
system-config-kdump-1.0.14-error-handling.patch
Log Message:
* Mon Apr 13 2009 Lubomir Rintel <lkundrak at v3.sk> - 1.0.14-6
- Improve error handling when applying settings
system-config-kdump-1.0.14-error-handling.patch:
--- NEW FILE system-config-kdump-1.0.14-error-handling.patch ---
Display an action progressbar while reconfiguring the boot loader
and generating the ram disk image. Handle errors and display
diagnostic information in case an error occur.
Lubomir Rintel <lkundrak at v3.sk>
diff -up system-config-kdump-1.0.14/src/system-config-kdump.py.error-handling system-config-kdump-1.0.14/src/system-config-kdump.py
--- system-config-kdump-1.0.14/src/system-config-kdump.py.error-handling 2009-04-13 21:46:19.789256429 +0200
+++ system-config-kdump-1.0.14/src/system-config-kdump.py 2009-04-13 21:46:27.429137877 +0200
@@ -1,7 +1,9 @@
# system-config-kdump.py - configures kexec/kdump
# Copyright (c) 2006 Red Hat, Inc.
+# Copyright (c) 2008 Lubomir Rintel
# Authors: Dave Lehman <dlehman at redhat.com>
# Jarod Wilson <jwilson at redhat.com>
+# Lubomir Rintel <lkundrak at v3.sk>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,6 +22,7 @@
import gtk
import gobject
import gtk.glade
+from rhpl.executil import gtkExecWithCaptureStatus
import sys
import os
@@ -338,16 +341,6 @@ class mainWindow:
else:
return
- kernelKdumpNote = ""
- if self.arch in kernelKdumpArches:
- kernelKdumpNote = _("\n\nNote that the %s architecture does not "
- "feature a relocatable kernel at this time, "
- "and thus requires a separate kernel-kdump "
- "package to be installed for kdump to "
- "function. This can be installed via 'yum "
- "install kernel-kdump' at your convenience."
- "\n\n") % self.arch
-
if self.xenKernel and self.kdumpEnabled:
self.showMessage(_("WARNING: xen kdump support requires a "
"non-xen %s RPM to perform actual crash "
@@ -356,18 +349,6 @@ class mainWindow:
"as your xen kernel installed.") %
(self.xenKdumpKernel, self.xenKdumpKernel))
- try:
- origKdumpMem = int(self.origCrashKernel.split("@")[0][:-1])
- except ValueError:
- origKdumpMem = 0
-
- if self.kdumpEnabled and self.kdumpMem != origKdumpMem:
- self.showMessage(_("Changing Kdump settings requires rebooting "
- "the system to reallocate memory accordingly. "
- "%sYou will have to reboot the system for the "
- "new settings to take effect.")
- % kernelKdumpNote)
-
if not testing:
if debug:
print "writing kdump config"
@@ -377,12 +358,13 @@ class mainWindow:
if debug:
print "writing bootloader config"
- self.writeBootloaderConfig()
+ if self.writeBootloaderConfig():
+ self.destroy()
+
else:
print "would have called writeDumpConfig"
print "would have called writeBootloaderConfig"
-
- self.destroy()
+ self.destroy()
def cancelClicked(self, *args):
self.destroy()
@@ -701,7 +683,7 @@ class mainWindow:
def writeBootloaderConfig(self):
if testing:
- return
+ return True
(blConfig, offset, kpath) = bootloaders[self.bootloader]
@@ -717,31 +699,94 @@ class mainWindow:
# Are we adding or removing the crashkernel param?
if self.kdumpEnabled:
crashKernel = "%iM" % (self.kdumpMem)
- grubbyCmd = '/sbin/grubby --%s --update-kernel=%s --%s="crashkernel=%s"' \
- % (self.bootloader, self.defKern,
- args, crashKernel)
+ grubbyCmd = ('/sbin/grubby', '--%s' % self.bootloader,
+ '--update-kernel=%s' % self.defKern,
+ '--%s="crashkernel=%s"' % (args, crashKernel))
chkconfigStatus = "on"
if self.origCrashKernel:
serviceOp = "restart"
else:
serviceOp = "start"
else:
- grubbyCmd = '/sbin/grubby --%s --update-kernel=%s --remove-%s="crashkernel=%s"' \
- % (self.bootloader, self.defKern,
- args, self.origCrashKernel)
+ grubbyCmd = ('/sbin/grubby', '--%s' % self.bootloader,
+ '--update-kernel=%s' % self.defKern,
+ '--remove-%s="crashkernel=%s"' % (args, self.origCrashKernel))
chkconfigStatus = "off"
- serviceOp = "stop"
+ if self.origCrashKernel:
+ serviceOp = "stop"
+ else:
+ serviceOp = None
if debug:
print "Using %s bootloader without offset" % (self.bootloader)
print "Grubby command:\n %s" % grubbyCmd
- # FIXME: use rhpl.executil (and handle errors)!
- os.system(grubbyCmd)
- os.system("/sbin/chkconfig kdump %s" % chkconfigStatus)
- os.system("/sbin/service kdump %s" % serviceOp)
- if self.bootloader == 'yaboot':
- os.system('/sbin/ybin')
+ # Distract the user while we build a dam from all her files
+ window = progressWindow(_("Applying configuration..."),
+ _("kdump is being reconfigured with the new settings now.\n"
+ "Please be patient, it can take up to one minute to complete."));
+ window.show()
+
+ rebootNeeded = False
+ try:
+ def call(*args):
+ (status, output) = gtkExecWithCaptureStatus(args[0], args, catchfd = (1, 2))
+ if status:
+ output = _("Command '%s' failed:\n%s") % (" ".join (args), output)
+ raise RuntimeError(output)
+
+ call(*grubbyCmd)
+ if self.bootloader == 'yaboot':
+ call("/sbin/ybin")
+ call("/sbin/chkconfig", "kdump", chkconfigStatus)
+
+ try:
+ if serviceOp:
+ call("/sbin/service", "kdump", serviceOp)
+ except:
+ # Tolerate problems in case the boot memory is not yet allocated,
+ # just tell the user to reboot. If the problem is not related to
+ # boot memory being allocated, she'll notice the kdump service fail
+ # anyways.
+ try:
+ origKdumpMem = int(self.origCrashKernel.split("@")[0][:-1])
+ except ValueError:
+ origKdumpMem = 0
+
+ if self.kdumpEnabled and self.kdumpMem != origKdumpMem:
+ rebootNeeded = True
+ else:
+ raise
+
+ except RuntimeError, output:
+ # RuntimeError is risen by call() as well as gtkExecWithCaptureStatus() itself
+ window.stop()
+ self.showErrorMessage (_("Couldn't apply the new configuration. Please revisit "
+ "the configuration dialog and try to correct the problem, "
+ "otherwise kdump will not function properly.\n\n%s" % output))
+ window.hide()
+ return False
+
+ kernelKdumpNote = ""
+ if self.arch in kernelKdumpArches:
+ kernelKdumpNote = _("\n\nNote that the %s architecture does not "
+ "feature a relocatable kernel at this time, "
+ "and thus requires a separate kernel-kdump "
+ "package to be installed for kdump to "
+ "function. This can be installed via 'yum "
+ "install kernel-kdump' at your convenience."
+ "\n\n") % self.arch
+
+ if rebootNeeded:
+ window.stop ()
+ self.showMessage(_("Changing Kdump settings requires rebooting "
+ "the system to reallocate memory accordingly. "
+ "%sYou will have to reboot the system for the "
+ "new settings to take effect.")
+ % kernelKdumpNote)
+
+ window.hide()
+ return True
def updateUsableMem(self, *args):
self.kdumpMem = int(args[0].get_value())
@@ -866,7 +911,49 @@ class mainWindow:
rc = False
return rc
-
+
+class progressWindow(gtk.Window):
+ def __init__(self, title, label):
+ gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
+ self.set_deletable(False)
+ self.set_resizable(False)
+ self.set_position(gtk.WIN_POS_CENTER)
+ self.set_modal(True)
+
+ self.set_title(title)
+ self.progress = gtk.ProgressBar()
+ self.progress.show()
+
+ label = gtk.Label(label)
+ label.show()
+
+ vbox = gtk.VBox()
+ vbox.set_spacing(10);
+ vbox.set_border_width(10);
+ vbox.show()
+
+ vbox.pack_start(label)
+ vbox.pack_start(self.progress)
+
+ self.add(vbox)
+
+ def start(self):
+ self.timer = gobject.timeout_add(100, lambda progress:
+ progress.pulse() or True, self.progress)
+
+ def stop(self):
+ if self.timer:
+ gobject.source_remove(self.timer)
+ self.timer = None
+
+ def show(self):
+ self.start()
+ gtk.Window.show(self)
+
+ def hide(self):
+ self.stop()
+ gtk.Window.hide(self)
+
if __name__ == "__main__":
import getopt
Index: system-config-kdump.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-kdump/devel/system-config-kdump.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- system-config-kdump.spec 23 Mar 2009 13:18:31 -0000 1.7
+++ system-config-kdump.spec 13 Apr 2009 19:48:57 -0000 1.8
@@ -1,7 +1,7 @@
Summary: A graphical interface for configuring kernel crash dumping
Name: system-config-kdump
Version: 1.0.14
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: http://fedora.redhat.com/projects/config-tools/
License: GPLv2+
Group: System Environment/Base
@@ -22,6 +22,7 @@
Patch2: system-config-kdump-1.0.14-fedora.patch
Patch3: system-config-kdump-1.0.14-ommit-offset.patch
Patch4: system-config-kdump-1.0.14-off-by-one.patch
+Patch5: system-config-kdump-1.0.14-error-handling.patch
%description
system-config-kdump is a graphical tool for configuring kernel crash
@@ -33,6 +34,7 @@
%patch2 -p1 -b .fedora
%patch3 -p1 -b .ommit-offset
%patch4 -p1 -b .off-by-one
+%patch5 -p1 -b .error-handling
%build
make
@@ -76,6 +78,9 @@
%doc ChangeLog COPYING
%changelog
+* Mon Apr 13 2009 Lubomir Rintel <lkundrak at v3.sk> - 1.0.14-6
+- Improve error handling when applying settings
+
* Mon Mar 23 2009 Roman Rakus <rrakus at redhat.com> - 1.0.14-5
- Fix off by one error in kernel command line parsing
Resolves #334269
- Previous message (by thread): rpms/leonidas-backgrounds/devel .cvsignore, 1.3, 1.4 leonidas-backgrounds.spec, 1.2, 1.3 sources, 1.3, 1.4
- Next message (by thread): rpms/nautilus/devel .cvsignore, 1.94, 1.95 nautilus-2.23.5-selinux.patch, 1.2, 1.3 nautilus.spec, 1.269, 1.270 sources, 1.98, 1.99
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list