clalancette / oz

Automated installation for guest images
GNU Lesser General Public License v2.1
310 stars 129 forks source link

Add in the ability for extra console logging. #233

Closed clalancette closed 7 years ago

clalancette commented 7 years ago

This is still using some hardcoded paths, and has some FIXME comments, and still prints things out to the console in an ugly way, but points to the direction we should go in here.

Signed-off-by: Chris Lalancette clalancette@gmail.com

clalancette commented 7 years ago

@imcleod @cgwalters @dustymabe: Here is a new take on the Fedora virtio console logging that has been hanging out for quite a while (apologies, my fault). This version uses the main wait_for_guest_install loop to select on a socket where the data from anaconda is going. Note that this does not have all of the features of the previous pull requests; in particular, it is missing:

  1. Support for RHEL/CentOS
  2. Changing the listen port to a Unix domain socket
  3. Gathering early boot information from Anaconda

I just wanted to keep this code small, so we can add the rest of those later. That all being said, there is one major problem with this code that needs to be solved before it can be merged. If you look closely, the self.consolelog variable is hardcoded to /var/lib/libvirt/qemu/vm-console.log. That works fine if you are installing as root, but does not work at all if you are installing as a user. When installing as a user, svirt (I believe) gets in the way here and doesn't allow that to happen. We'll need to figure out a way to make this work for non-root installs, since that is an important use case. Unfortunately, I don't know how to do this, so please take a look, and see if you can figure out how to do it. Note that if the solution consists of using some variant of chcon, keep in mind that this has to work on Ubuntu/Debian hosts as well. Once we fix that problem, this can go in. So please take a look, and give me any thoughts you might have on solving this last problem.

clalancette commented 7 years ago

Ah, I found the problem. It is the same reason why we haven't been able to switch the console over to a Unix domain socket; there is something that goes wacky in the permissions when you run as a normal user. If I switch to a TCP socket (like the console), things work fine. I'm actually going to go with this solution for now; when/if we figure out the console Unix domain socket, we can change the anaconda one as well. I'm going to merge this up to master and then close this out. Feel free to open additional PRs that add some of the missing functionality, including early boot-time logging and RHEL/CentOS support.

dustymabe commented 7 years ago

hey @clalancette - thanks for this, will give it a spin and give feedback.

dustymabe commented 7 years ago

seems to work decently well - new release sometime soon?