Bug 1391383

Summary: SPC - Cannot restart host operating from container
Product: Red Hat Enterprise Linux 7 Reporter: Marcel Kolaja <mkolaja>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Branislav Blaškovič <bblaskov>
Severity: high Docs Contact:
Priority: urgent    
Version: 7.2CC: bblaskov, bbreard, dphillip, dwalsh, fsumsal, lnykryn, mkolaja, msekleta, ovasik, riek, scollier, snagar, systemd-maint-list
Target Milestone: rcKeywords: EasyFix, Patch, ZStream
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-219-30.el7_3.4 Doc Type: Enhancement
Doc Text:
Cause: systemctl refuses to perform any action when it is running inside chroot environment. Consequence: This is a problem with super privileged containers where you want to administer to host system. Fix: systemctl will now skip the check for chroot if environment variable SYSTEMD_IGNORE_CHROOT=yes is set Result:
Story Points: ---
Clone Of: 1379852 Environment:
Last Closed: 2016-11-09 21:40:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1379852    
Bug Blocks:    

Description Marcel Kolaja 2016-11-03 08:37:56 UTC
This bug has been copied from bug #1379852 and has been proposed
to be backported to 7.3 z-stream (EUS).

Comment 4 Branislav Blaškovič 2016-11-09 13:49:48 UTC
I've tested this with systemd-219-30.el7 in chroot:

# systemctl list-units
Running in chroot, ignoring request.

With the newest version systemd-219-30.el7_3.6 it works the same:
# systemctl list-units
Running in chroot, ignoring request.

But when used with SYSTEMD_IGNORE_CHROOT set to something bigger than 0, it actually works:
# PAGER= SYSTEMD_IGNORE_CHROOT=1 systemctl list-units
UNIT                                     LOAD   ACTIVE SUB       DESCRIPTION
proc-sys-fs-binfmt_misc.automount        loaded active waiting   Arbitrary Executable File Formats File Sy
sys-devices-pci0000:00-0000:00:03.0-virtio0-net-eth0.device loaded active plugged   Virtio network device
sys-devices-pci0000:00-0000:00:04.0-virtio1-block-vda-vda1.device loaded active plugged   /sys/devices/pci0000:00/0000:00:04.0/virt
sys-devices-pci0000:00-0000:00:04.0-virtio1-block-vda-vda2.device loaded active plugged   /sys/devices/pci0000:00/0000:00:04.0/virt
sys-devices-pci0000:00-0000:00:04.0-virtio1-block-vda-vda3.device loaded active plugged   LVM PV CPw1A0-fZ9Z-q0Ac-G9I7-LJeT-Czec-fh
sys-devices-pci0000:00-0000:00:04.0-virtio1-block-vda-vda4.device loaded active plugged   LVM PV lMyfYY-htIo-uazs-FkPe-VCOg-kA13-PJ
sys-devices-pci0000:00-0000:00:04.0-virtio1-block-vda.device loaded active plugged   /sys/devices/pci0000:00/0000:00:04.0/virt
sys-devices-platform-serial8250-tty-ttyS2.device loaded active plugged   /sys/devices/platform/serial8250/tty/ttyS

I will write an automated testcase soon.

Switching to VERIFIED.

Comment 6 errata-xmlrpc 2016-11-09 21:40:06 UTC
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.

https://rhn.redhat.com/errata/RHBA-2016-2698.html