Update to use systemctl instead of sysv chkconfig
use systemctl to check/set the service enable/disable status Signed-off-by: Dave Young <dyoung@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
93e13c118b
commit
f1638fbe8a
@ -150,8 +150,8 @@ class moduleClass(Module):
|
|||||||
self.kdumpOffset = 0
|
self.kdumpOffset = 0
|
||||||
self.origCrashKernel = ""
|
self.origCrashKernel = ""
|
||||||
self.kdumpEnabled = False
|
self.kdumpEnabled = False
|
||||||
chkConfigStatus=commands.getoutput('/sbin/chkconfig --list kdump')
|
chkConfigStatus=commands.getoutput('/bin/systemctl is-enabled kdump.service')
|
||||||
if chkConfigStatus.find("on") > -1:
|
if chkConfigStatus.find("enabled") > -1:
|
||||||
self.kdumpEnabled = True
|
self.kdumpEnabled = True
|
||||||
self.kdumpMemInitial = 0
|
self.kdumpMemInitial = 0
|
||||||
if cmdLine.find("crashkernel") > -1:
|
if cmdLine.find("crashkernel") > -1:
|
||||||
@ -356,18 +356,18 @@ class moduleClass(Module):
|
|||||||
if self.kdumpEnabled:
|
if self.kdumpEnabled:
|
||||||
grubbyCmd = "/sbin/grubby --%s --update-kernel=/boot/vmlinuz-%s --args=crashkernel=%iM" \
|
grubbyCmd = "/sbin/grubby --%s --update-kernel=/boot/vmlinuz-%s --args=crashkernel=%iM" \
|
||||||
% (self.bootloader, self.runningKernel, reservedMem)
|
% (self.bootloader, self.runningKernel, reservedMem)
|
||||||
chkconfigStatus = "on"
|
chkconfigStatus = "enable"
|
||||||
else:
|
else:
|
||||||
grubbyCmd = "/sbin/grubby --%s --update-kernel=/boot/vmlinuz-%s --remove-args=crashkernel=%s" \
|
grubbyCmd = "/sbin/grubby --%s --update-kernel=/boot/vmlinuz-%s --remove-args=crashkernel=%s" \
|
||||||
% (self.bootloader, self.runningKernel, self.origCrashKernel)
|
% (self.bootloader, self.runningKernel, self.origCrashKernel)
|
||||||
chkconfigStatus = "off"
|
chkconfigStatus = "disable"
|
||||||
|
|
||||||
if self.doDebug:
|
if self.doDebug:
|
||||||
print "Using %s bootloader with %iM offset" % (self.bootloader, self.offset)
|
print "Using %s bootloader with %iM offset" % (self.bootloader, self.offset)
|
||||||
print "Grubby command would be:\n %s" % grubbyCmd
|
print "Grubby command would be:\n %s" % grubbyCmd
|
||||||
else:
|
else:
|
||||||
os.system(grubbyCmd)
|
os.system(grubbyCmd)
|
||||||
os.system("/sbin/chkconfig kdump %s" % chkconfigStatus)
|
os.system("/bin/systemctl %s kdump.service" % (chkconfigStatus))
|
||||||
if self.bootloader == 'yaboot':
|
if self.bootloader == 'yaboot':
|
||||||
os.system('/sbin/ybin')
|
os.system('/sbin/ybin')
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user