Orabuntu-LXC logs the installation using sudo and sudoreplay. The logs of install sessions are stored at /opt/olxc/installs/logs. The typical code that creates the logging facility is shown below (this example is from anylinux-services.VM.ON.HUB.HOST.1500). if [ ! -d "$DistDir"/installs/logs ]then sudo mkdir -p "$DistDir"/installs/logsfiif [ -f "$DistDir"/installs/logs/$USER.log ]then sudo mv "$DistDir"/installs/logs/$USER.log "$DistDir"/installs/logs/$USER.log.$LOGEXTfiif [ ! -d /var/log/sudo-io ]then sudo mkdir -m 750 /var/log/sudo-iofiif [ ! -f /etc/sudoers.d/orabuntu-lxc ]then sudo sh -c "echo 'Defaults logfile=\"$DistDir/installs/logs/$USER.log\"' >> /etc/sudoers.d/orabuntu-lxc" sudo sh -c "echo 'Defaults log_input,log_output' >> /etc/sudoers.d/orabuntu-lxc" sudo sh -c "echo 'Defaults iolog_dir=/var/log/sudo-io/%{user}' >> /etc/sudoers.d/orabuntu-lxc" sudo chmod 0440 /etc/sudoers.d/orabuntu-lxcfiDuring the install the logging can be monitored by using the following command as shown below. [ubuntu@oracle76b logs]$ pwdtotal 1284-rw-r--r--. 1 ubuntu ubuntu 889205 Apr 14 12:30 ubuntu.log[ubuntu@oracle76b logs]$ sudo tail -f ubuntu.log [sudo] password for ubuntu: ; USER=root ; TSID=0002ZB ; COMMAND=/bin/lxc-create -n oel76c13 -t oracle -- --release=7.6Apr 14 12:29:17 : ubuntu : TTY=pts/0 ; PWD=/home/ubuntu/Downloads/orabuntu-lxc-6.11.5-beta/anylinux ; USER=root ; COMMAND=validateApr 14 12:30:17 : ubuntu : TTY=pts/0 ; PWD=/home/ubuntu/Downloads/orabuntu-lxc-6.11.5-beta/anylinux ; USER=root ; COMMAND=validateApr 14 12:30:30 : ubuntu : TTY=pts/1 ; PWD=/opt/olxc/installs/logs ; USER=root ; TSID=0002ZC ; COMMAND=/bin/tail -f ubuntu.logApr 14 12:31:17 : ubuntu : TTY=pts/0 ; PWD=/home/ubuntu/Downloads/orabuntu-lxc-6.11.5-beta/anylinux ; USER=root ; COMMAND=validateThe sudoreplay facility can then be used to actually play back the entire install session as a video. The session playback can be speeded up or slowed down to quickly get to a specific phase of the install. For example, to replay the actual install result for any step that involved "lxc-2.0.8-1.el7.x86_64.rpm" that was built from source code by Orabuntu-LXC during the install, the following steps could be used as shown below. [ubuntu@oracle76b logs]$ sudo sudoreplay -l | grep -A2 -B2 lxc-2.0.8-1.el7.x86_64.rpmApr
14 11:51:53 2019 : ubuntu : TTY=/dev/pts/0 ;
CWD=/opt/olxc/home/ubuntu/Downloads/orabuntu-lxc-6.11.5-beta/uekulele/lxc
; USER=root ; TSID=ubuntu/00/02/RA ; COMMAND=/bin/sed -i
/sysconfig/s/\*//
/opt/olxc//home/ubuntu/Downloads/orabuntu-lxc-6.11.5-beta/uekulele/lxc/lxc.specApr
14 11:51:53 2019 : ubuntu : TTY=/dev/pts/0 ;
CWD=/opt/olxc/home/ubuntu/Downloads/orabuntu-lxc-6.11.5-beta/uekulele/lxc
; USER=root ; TSID=ubuntu/00/02/RB ; COMMAND=/bin/sh -c echo
'%_unpackaged_files_terminate_build 0' >> /etc/rpm/macrosApr
14 11:55:54 2019 : ubuntu : TTY=/dev/pts/0 ;
CWD=/opt/olxc/home/ubuntu/Downloads/orabuntu-lxc-6.11.5-beta/uekulele/lxc/rpmbuild/RPMS/x86_64
; USER=root ; TSID=ubuntu/00/02/RC ; COMMAND=/bin/yum -y localinstall
lxc-2.0.8-1.el7.x86_64.rpm lxc-debuginfo-2.0.8-1.el7.x86_64.rpm
lxc-devel-2.0.8-1.el7.x86_64.rpm lxc-libs-2.0.8-1.el7.x86_64.rpmApr
14 11:56:16 2019 : ubuntu : TTY=/dev/pts/0 ;
CWD=/opt/olxc/home/ubuntu/Downloads/orabuntu-lxc-6.11.5-beta/uekulele/lxc
; USER=root ; TSID=ubuntu/00/02/RD ; COMMAND=/bin/lxc-checkconfigApr
14 11:56:26 2019 : ubuntu : TTY=/dev/pts/0 ;
CWD=/opt/olxc/home/ubuntu/Downloads/orabuntu-lxc-6.11.5-beta/uekulele/lxc
; USER=root ; TSID=ubuntu/00/02/RE ; COMMAND=/sbin/ifconfig virbr0[ubuntu@oracle76b logs]$ sudo sudoreplay ubuntu/00/02/RCReplaying
sudo session: /bin/yum -y localinstall lxc-2.0.8-1.el7.x86_64.rpm
lxc-debuginfo-2.0.8-1.el7.x86_64.rpm lxc-devel-2.0.8-1.el7.x86_64.rpm
lxc-libs-2.0.8-1.el7.x86_64.rpmLoaded plugins: langpacks, ulninfoExamining lxc-2.0.8-1.el7.x86_64.rpm: lxc-2.0.8-1.el7.x86_64Marking lxc-2.0.8-1.el7.x86_64.rpm as an update to lxc-1.1.5-2.0.11.el7.x86_64Examining lxc-debuginfo-2.0.8-1.el7.x86_64.rpm: lxc-debuginfo-2.0.8-1.el7.x86_64Marking lxc-debuginfo-2.0.8-1.el7.x86_64.rpm to be installedExamining lxc-devel-2.0.8-1.el7.x86_64.rpm: lxc-devel-2.0.8-1.el7.x86_64Marking lxc-devel-2.0.8-1.el7.x86_64.rpm to be installedExamining lxc-libs-2.0.8-1.el7.x86_64.rpm: lxc-libs-2.0.8-1.el7.x86_64Marking lxc-libs-2.0.8-1.el7.x86_64.rpm as an update to lxc-libs-1.1.5-2.0.11.el7.x86_64Resolving Dependencies--> Running transaction check---> Package lxc.x86_64 0:1.1.5-2.0.11.el7 will be updated---> Package lxc.x86_64 0:2.0.8-1.el7 will be an update---> Package lxc-debuginfo.x86_64 0:2.0.8-1.el7 will be installed---> Package lxc-devel.x86_64 0:2.0.8-1.el7 will be installed---> Package lxc-libs.x86_64 0:1.1.5-2.0.11.el7 will be updated---> Package lxc-libs.x86_64 0:2.0.8-1.el7 will be an update--> Finished Dependency ResolutionDependencies Resolved=================================================================================================================================================================================================================== Package
Arch
Version
Repository
Size===================================================================================================================================================================================================================Installing: lxc-debuginfo
x86_64
2.0.8-1.el7
/lxc-debuginfo-2.0.8-1.el7.x86_64 3.8 M lxc-devel
x86_64
2.0.8-1.el7
/lxc-devel-2.0.8-1.el7.x86_64 38 kUpdating: lxc
x86_64
2.0.8-1.el7
/lxc-2.0.8-1.el7.x86_64 959 k lxc-libs
x86_64
2.0.8-1.el7
/lxc-libs-2.0.8-1.el7.x86_64 688 kTransaction Summary===================================================================================================================================================================================================================Install 2 PackagesUpgrade 2 PackagesTotal size: 5.5 MDownloading packages:Running transaction checkRunning transaction testTransaction test succeededRunning transaction
Updating :
lxc-libs-2.0.8-1.el7.x86_64
1/6 Updating :
lxc-2.0.8-1.el7.x86_64
2/6 /var/tmp/rpm-tmp.yKJgxS: line 14: /usr/local/etc/default/lxc-net: No such file or directorywarning: %post(lxc-2.0.8-1.el7.x86_64) scriptlet failed, exit status 1Non-fatal POSTIN scriptlet failure in rpm package lxc-2.0.8-1.el7.x86_64
Installing :
lxc-devel-2.0.8-1.el7.x86_64
3/6 Installing :
lxc-debuginfo-2.0.8-1.el7.x86_64
4/6 Cleanup :
lxc-1.1.5-2.0.11.el7.x86_64
5/6 Cleanup :
lxc-libs-1.1.5-2.0.11.el7.x86_64
6/6 Verifying :
lxc-2.0.8-1.el7.x86_64
1/6 Verifying :
lxc-debuginfo-2.0.8-1.el7.x86_64
2/6 Verifying :
lxc-devel-2.0.8-1.el7.x86_64
3/6 Verifying :
lxc-libs-2.0.8-1.el7.x86_64
4/6 Verifying :
lxc-1.1.5-2.0.11.el7.x86_64
5/6 Verifying :
lxc-libs-1.1.5-2.0.11.el7.x86_64
6/6 Installed:
lxc-debuginfo.x86_64
0:2.0.8-1.el7
lxc-devel.x86_64
0:2.0.8-1.el7
Updated: lxc.x86_64
0:2.0.8-1.el7
lxc-libs.x86_64
0:2.0.8-1.el7
Complete![ubuntu@oracle76b logs]$ Note that when the command "sudo sudoreplay ubunt/00/02/RC" runs, what is shown in terminal is a recording of the the actual session played back. |
Installation >