Red Hat Bugzilla – Bug 955543
[RFE]Rewrite "the reboot implementation" in ovirt_boot_setup(self, reboot="N") of install.py
Last modified: 2014-08-04 19:24:59 EDT
Description of problem: According to comment14 &&15 BZ#849315, so it's better that rewrite "the reboot implementation" instead of using crond for the async reboot. But actually, in rhev-h 6.4, it still used old method about "the reboot implementation" if reboot is not None and reboot == "Y": f = open('/var/spool/cron/root', 'w') f.write('* * * * * sleep 10 && /sbin/reboot\n') f.close() #ensure crond is started _functions.subprocess_closefds("crond", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) it's better to using this method of Alon Bar-Lev mentioned: http://gerrit.ovirt.org/gitweb?p=vdsm.git;a=blob;f=vdsm_reg/deployUtil.py.in;hb=HEAD#l202 Seem that this new "reboot implementation" is more considerate and may avoid potential issues caused by the crude reboot. #!/usr/bin/env python import os import sys import time def simpleDaemon(main, args=(), kwargs={}): # Default maximum for the number of available file descriptors. MAXFD = 1024 import resource # Resource usage information. maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1] if (maxfd == resource.RLIM_INFINITY): maxfd = MAXFD pid = os.fork() if pid == 0: try: os.setsid() for fd in range(0, maxfd): try: os.close(fd) except OSError: # ERROR, fd wasn't open to begin with (ignored) pass os.open(os.devnull, os.O_RDWR) # standard input (0) os.dup2(0, 1) # standard output (1) os.dup2(0, 2) # standard error (2) if os.fork() != 0: os._exit(0) try: main(*args, **kwargs) except: import traceback traceback.print_exc() finally: os._exit(1) pid, status = os.waitpid(pid, 0) if not os.WIFEXITED(status) or os.WEXITSTATUS(status) != 0: raise RuntimeError('Daemon not exited properly') def delayedReboot(reboot, sleepTime): time.sleep(sleepTime) os.execl(reboot, reboot) def reboot( delay): simpleDaemon( delayedReboot, ( "/sbin/reboot", delay, ) ) reboot(10) Version-Release number of selected component (if applicable): rhev-hypervisor6-6.4-20130415.0.el6_4 How reproducible: 100% Steps to Reproduce: Actual result: Expect result: Additional info:
Test version: rhev-hypervisor6-6.5-20131017.0.iso ovirt-node-3.0.1-4.el6 The install module now uses the async daemon created and has a default delay of 3 seconds. Also now the tui installer calls the new reboot method. For the default delay time is 3 seconds not 10 seconds, i have report another bug 1021437 - "delay time is short before reboot for auto install process" to track it. this bug has been fixed, change the status into "VERIFIED"
This bug is currently attached to errata RHBA-2013:15277. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag. Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information: * Cause: What actions or circumstances cause this bug to present. * Consequence: What happens when the bug presents. * Fix: What was done to fix the bug. * Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore') Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug. For further details on the Cause, Consequence, Fix, Result format please refer to: https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes Thanks in advance.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-0033.html