GithubHelp home page GithubHelp logo

Comments (14)

GeorgeDuckman avatar GeorgeDuckman commented on May 29, 2024 1

@zhukovgreen Yes the manual reboot works.
Thanks

from convert2rhel.

zhukovgreen avatar zhukovgreen commented on May 29, 2024

Thx @GeorgeDuckman We'll look into this and let you know

from convert2rhel.

zhukovgreen avatar zhukovgreen commented on May 29, 2024

@fellipeh I see that this env={'LC_ALL': 'C'} in run_subprocess was introduced in #83. Any ideas around this issue?

from convert2rhel.

zhukovgreen avatar zhukovgreen commented on May 29, 2024

Tracked under https://issues.redhat.com/browse/OAMG-4719

from convert2rhel.

zhukovgreen avatar zhukovgreen commented on May 29, 2024

Hi @GeorgeDuckman, are you unable to extract the conversion logs from the unbootable machine (located at /var/log/convert2rhel/convert2rhel.log). Thank you

from convert2rhel.

GeorgeDuckman avatar GeorgeDuckman commented on May 29, 2024

Hello @zhukovgreen, below the requested file, I had to delete some lines for professional reasons:

convert2rhel.log

Thank you.

from convert2rhel.

zhukovgreen avatar zhukovgreen commented on May 29, 2024

@oamg/Convert2RHEL it seems @GeorgeDuckman hit a bug. From the log, I see that convert2rhel runs reboot command which doesn't exists on centos6.

from convert2rhel.

zhukovgreen avatar zhukovgreen commented on May 29, 2024

Thanks, @GeorgeDuckman, we'll notify you of fixing this. However, it might unblock you, if you will try to run the convert2rhel utility without -r option:
-r, --restart Restart the system when it is successfully converted
to RHEL to boot the new RHEL kernel.
Please let me now if this manual reboot works for you

from convert2rhel.

zhukovgreen avatar zhukovgreen commented on May 29, 2024

@GeorgeDuckman could you please check output on the centos6 host which is failing to convert:

echo $PATH
ls /sbin/reboot
ls /sbin/shutdown

We are trying to reproduce the error

from convert2rhel.

GeorgeDuckman avatar GeorgeDuckman commented on May 29, 2024

@zhukovgreen I'll see to revert the host to a CentOS 6 server as soon as possible.

But if it helps, in my first post I said that the reboot command exists, I managed to use it from the command line. I then reproduced the code of the reboot function of convert2rhel and the reboot command is well executed by removing the "env={'LC_ALL': 'C'}" parameter part, which is surprising I admit.

from convert2rhel.

bocekm avatar bocekm commented on May 29, 2024

@GeorgeDuckman, when you try the conversion again, please try changing the line that runs the reboot (https://github.com/oamg/convert2rhel/blob/v0.20/convert2rhel/utils.py#L117) to run_subprocess("/sbin/reboot"), instead of removing the env.
I hope that can resolve the issue.

from convert2rhel.

bocekm avatar bocekm commented on May 29, 2024

I was able to reproduce the issue in the CentOS 6.10 vagrant box we use for testing and development with just using -r option. The above I recommended ("/sbin/reboot") fixed that.

from convert2rhel.

pirat89 avatar pirat89 commented on May 29, 2024

The explanation of the root cause is here: https://github.com/oamg/convert2rhel/pull/251/files#r616752752

from convert2rhel.

GeorgeDuckman avatar GeorgeDuckman commented on May 29, 2024

Sorry for the wait.
Here is some more information :

[root@serv~]# whereis reboot
reboot: /sbin/reboot /usr/share/man/man2/reboot.2.gz /usr/share/man/man8/reboot.8.gz

[root@serv~]# whereis shutdown
shutdown: /sbin/shutdown /usr/share/man/man3p/shutdown.3p.gz /usr/share/man/man2/shutdown.2.gz /usr/share/man/man8/shutdown.8.gz

And thanks @bocekm and @pirat89 , I tried replacing "reboot" with "/sbin/reboot" and it works flawlessly now. Here's the tiny script I used to test it :

import subprocess
import sys
import shlex

def run_subprocess(cmd="", print_cmd=True, print_output=True):
    """Call the passed command and optionally log the called command (print_cmd=True) and its
    output (print_output=True). Switching off printing the command can be useful in case it contains
    a password in plain text.
    """
    if print_cmd:
        print("Calling command '%s'" % cmd)

    # Python 2.6 has a bug in shlex that interprets certain characters in a string as
    # a NULL character. This is a workaround that encodes the string to avoid the issue.
    if sys.version_info[0] == 2 and sys.version_info[1] == 6:
        cmd = cmd.encode("ascii")
    cmd = shlex.split(cmd, False)
    process = subprocess.Popen(cmd,
                               stdout=subprocess.PIPE,
                               stderr=subprocess.STDOUT,
                               bufsize=1,
                               env={'LC_ALL': 'C'})
    output = ''
    for line in iter(process.stdout.readline, b''):
        output += line.decode()
        if print_output:
            print(line.decode().rstrip('\n'))

    # Call communicate() to wait for the process to terminate so that we can get the return code by poll().
    # It's just for py2.6, py2.7+/3 doesn't need this.
    process.communicate()

    return_code = process.poll()
    return output, return_code

run_subprocess("/sbin/reboot")

from convert2rhel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.