Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 990347 - fail to start systemd container with latest systemd
Summary: fail to start systemd container with latest systemd
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt-sandbox
Version: 7.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Daniel Berrange
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-31 03:02 UTC by Wayne Sun
Modified: 2019-02-14 02:22 UTC (History)
5 users (show)

Fixed In Version: libvirt-sandbox-0.5.0-2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 09:43:39 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Wayne Sun 2013-07-31 03:02:39 UTC
Description of problem:
update systemd to latest which did not create soft link
# ll /bin/systemd
ls: cannot access /bin/systemd: No such file or directory

# ll /lib/systemd/systemd
-rwxr-xr-x. 1 root root 1181152 Jul 26 20:57 /lib/systemd/systemd

start systemd container will fail

Version-Release number of selected component (if applicable):
libvirt-1.1.1-1.el7.x86_64
libvirt-sandbox-0.2.1-1.el7.x86_64
systemd-206-1.el7.x86_64
kernel-3.9.0-0.55.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. create a systemd container
virt-sandbox-service create -C -u httpd.service -s static,label=system_u:system_r:svirt_lxc_net_t:s0:c45,c20 -N dhcp,source=default testbox
2. start it
# virt-sandbox-service start testbox
libvirt-sandbox-init-common: run_service: cannot execute /bin/systemd: No such file or directory

3.

Actual results:
fail to start container

Expected results:
success

Additional info:
with systemd-204-8.el7
# ll /bin/systemd
lrwxrwxrwx. 1 root root 22 Jul 31 10:48 /bin/systemd -> ../lib/systemd/systemd

Comment 2 Wayne Sun 2013-08-02 06:33:33 UTC
Fixed in upstream

commit 47caee5911f3ffe7c75af1f2b18d4aa1db662533
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Thu Aug 1 17:17:40 2013 +0100

    Fix path to systemd binary
    
    Systemd's preferred path is /lib/systemd/systemd, not /bin/systemd.
    The latter was a temporary symlink, now removed.
    
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

Comment 3 Wayne Sun 2013-08-14 03:41:53 UTC
pkgs:
libvirt-sandbox-0.5.0-2.el7.x86_64
libvirt-1.1.1-2.el7.x86_64
kernel-3.10.0-5.el7.x86_64
systemd-206-4.el7.x86_64
selinux-policy-3.12.1-70.el7.noarch

1. 
# ll /bin/systemd
ls: cannot access /bin/systemd: No such file or directory

# systemctl status testbox5_sandbox
testbox5_sandbox.service - Secure Sandbox Container testbox5
   Loaded: loaded (/etc/systemd/system/testbox5_sandbox.service; disabled)
   Active: failed (Result: exit-code) since Wed 2013-08-14 11:26:42 CST; 2s ago
  Process: 1537 ExecStop=/usr/bin/virsh -c lxc:/// destroy testbox5 (code=exited, status=1/FAILURE)
  Process: 1486 ExecStart=/usr/libexec/virt-sandbox-service-util -c lxc:/// -s testbox5 (code=exited, status=0/SUCCESS)
 Main PID: 1486 (code=exited, status=0/SUCCESS)

Aug 14 11:26:41 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1486]: 2013-08-14 03:26:41.691+0000: 1: debug : virFileClose:90 : Closed fd 13
Aug 14 11:26:41 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1486]: 2013-08-14 03:26:41.691+0000: 1: debug : virFileClose:90 : Closed fd 14
Aug 14 11:26:41 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1486]: 2013-08-14 03:26:41.691+0000: 1: debug : virFileClose:90 : Closed fd 25
Aug 14 11:26:41 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1486]: 2013-08-14 03:26:41.691+0000: 1: debug : virFileClose:90 : Closed fd 34
Aug 14 11:26:41 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1486]: 2013-08-14 03:26:41.692+0000: 1: debug : lxcContainerSetupFDs:347 : rc=0
Aug 14 11:26:41 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1486]: libvirt-sandbox-init-common: run_service: cannot execute /bin/systemd: No such file or directory
Aug 14 11:26:42 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virsh[1537]: error: Failed to destroy domain testbox5
Aug 14 11:26:42 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virsh[1537]: error: Requested operation is not valid: Domain is not running
Aug 14 11:26:42 hp-dl385g7-04.qe.lab.eng.nay.redhat.com systemd[1]: testbox5_sandbox.service: control process exited, code=exited status=1
Aug 14 11:26:42 hp-dl385g7-04.qe.lab.eng.nay.redhat.com systemd[1]: Unit testbox5_sandbox.service entered failed state.


The problem still exist here...

2. create soft link
# ln -s /lib/systemd/systemd /bin/systemd

# systemctl start testbox5_sandbox

# systemctl status testbox5_sandbox
testbox5_sandbox.service - Secure Sandbox Container testbox5
   Loaded: loaded (/etc/systemd/system/testbox5_sandbox.service; disabled)
   Active: active (running) since Wed 2013-08-14 11:30:38 CST; 5s ago
  Process: 1537 ExecStop=/usr/bin/virsh -c lxc:/// destroy testbox5 (code=exited, status=1/FAILURE)
 Main PID: 1567 (virt-sandbox-se)
   CGroup: /system.slice/testbox5_sandbox.service
           └─1567 /usr/libexec/virt-sandbox-service-util -c lxc:/// -s testbox5

Aug 14 11:30:38 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1567]: [  OK  ] Reached target System Initialization.
Aug 14 11:30:38 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1567]: [  OK  ] Listening on D-Bus System Message Bus Socket.
Aug 14 11:30:38 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1567]: [  OK  ] Reached target Sockets.
Aug 14 11:30:38 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1567]: [  OK  ] Reached target Timers.
Aug 14 11:30:38 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1567]: [  OK  ] Reached target Basic System.
Aug 14 11:30:38 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1567]: Starting The Apache HTTP Server...
Aug 14 11:30:38 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1567]: Starting Cleanup of Temporary Directories...
Aug 14 11:30:38 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1567]: [  OK  ] Started Cleanup of Temporary Directories.
Aug 14 11:30:39 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1567]: [  OK  ] Started The Apache HTTP Server.
Aug 14 11:30:39 hp-dl385g7-04.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[1567]: [  OK  ] Reached target Sandbox multi-user target.

Comment 4 Daniel Berrange 2013-08-14 14:12:30 UTC
Hmm, the systemd path is likely encoded in the sandbox config files. So you'll need to test with a newly created sandbox.

Meanwhile, I'll see if we can make the 'upgrade' command be able to fix this.

Comment 5 Wayne Sun 2013-08-15 03:31:23 UTC
(In reply to Daniel Berrange from comment #4)
> Hmm, the systemd path is likely encoded in the sandbox config files. So
> you'll need to test with a newly created sandbox.
> 
> Meanwhile, I'll see if we can make the 'upgrade' command be able to fix this.

newly created sandbox will fail also. 

# grep systemd /etc/libvirt-sandbox/services/testbox5/config/sandbox.cfg
target=/etc/systemd/system
source=/var/lib/libvirt/filesystems/testbox5/etc/systemd/system
target=/usr/lib/systemd/system/basic.target.wants
source=/var/lib/libvirt/filesystems/testbox5/usr/lib/systemd/system/basic.target.wants
target=/usr/lib/systemd/system/local-fs.target.wants
source=/var/lib/libvirt/filesystems/testbox5/usr/lib/systemd/system/local-fs.target.wants
target=/usr/lib/systemd/system/multi-user.target.wants
source=/var/lib/libvirt/filesystems/testbox5/usr/lib/systemd/system/multi-user.target.wants
target=/usr/lib/systemd/system/sysinit.target.wants
source=/var/lib/libvirt/filesystems/testbox5/usr/lib/systemd/system/sysinit.target.wants
target=/usr/lib/systemd/system/sockets.target.wants
source=/var/lib/libvirt/filesystems/testbox5/usr/lib/systemd/system/sockets.target.wants

only shows mount path.

The default init path in container xml is 
    <init>/usr/libexec/libvirt-sandbox-init-lxc</init>

when I update it to:
    <init>/lib/systemd/systemd</init>

the container can be started.

Comment 6 Wayne Sun 2013-09-24 08:46:37 UTC
pkgs:
libvirt-1.1.1-6.el7.x86_64
libvirt-sandbox-0.5.0-3.el7.x86_64
systemd-207-2.el7.x86_64
kernel-3.10.0-23.el7.x86_64
selinux-policy-3.12.1-80.el7.noarch

steps:
# virt-sandbox-service create -C -u httpd.service -s static,label=system_u:system_r:svirt_lxc_net_t:s0:c45,c20 -N dhcp,source=default testbox
Created sandbox container dir /var/lib/libvirt/filesystems/testbox
Created unit file /etc/systemd/system/testbox_sandbox.service
Created sandbox config /etc/libvirt-sandbox/services/testbox/config/sandbox.cfg

# systemctl start testbox_sandbox

# systemctl status testbox_sandbox
testbox_sandbox.service - Secure Sandbox Container testbox
   Loaded: loaded (/etc/systemd/system/testbox_sandbox.service; disabled)
   Active: active (running) since Tue 2013-09-24 16:41:54 CST; 4s ago
 Main PID: 15792 (virt-sandbox-se)
   CGroup: /system.slice/testbox_sandbox.service
           └─15792 /usr/libexec/virt-sandbox-service-util -c lxc:/// -s testbox

Sep 24 16:41:55 hp-dl385g7-03.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[15792]: [  OK  ] Reached target System Initialization.
Sep 24 16:41:55 hp-dl385g7-03.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[15792]: [  OK  ] Listening on D-Bus System Message Bus Socket.
Sep 24 16:41:55 hp-dl385g7-03.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[15792]: [  OK  ] Reached target Sockets.
Sep 24 16:41:55 hp-dl385g7-03.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[15792]: [  OK  ] Reached target Timers.
Sep 24 16:41:55 hp-dl385g7-03.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[15792]: [  OK  ] Reached target Basic System.
Sep 24 16:41:55 hp-dl385g7-03.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[15792]: Starting The Apache HTTP Server...
Sep 24 16:41:55 hp-dl385g7-03.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[15792]: Starting Cleanup of Temporary Directories...
Sep 24 16:41:55 hp-dl385g7-03.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[15792]: [  OK  ] Started Cleanup of Temporary Directories.
Sep 24 16:41:55 hp-dl385g7-03.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[15792]: [  OK  ] Started The Apache HTTP Server.
Sep 24 16:41:55 hp-dl385g7-03.qe.lab.eng.nay.redhat.com virt-sandbox-service-util[15792]: [  OK  ] Reached target Sandbox multi-user target.

works now, mark fixed.

Comment 8 Ludek Smid 2014-06-13 09:43:39 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.