Bug 1003720 - fail to create postfix container
fail to create postfix container
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt-sandbox (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Daniel Berrange
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2013-09-02 22:31 EDT by zhe peng
Modified: 2014-06-13 06:10 EDT (History)
5 users (show)

See Also:
Fixed In Version: libvirt-sandbox-0.5.0-4.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-13 06:10:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description zhe peng 2013-09-02 22:31:15 EDT
Description of problem:
Can't create container with postfix.service.

Version-Release number of selected component (if applicable):

How reproducible:


Steps to Reproduce:
1. create a container with postfix
# virt-sandbox-service create -C -u postfix.service mypost
Traceback (most recent call last):
  File "/usr/bin/virt-sandbox-service", line 1160, in <module>
  File "/usr/bin/virt-sandbox-service", line 811, in create
  File "/usr/bin/virt-sandbox-service", line 748, in create
    raise e
shutil.Error: [('/var/spool/postfix/public/qmgr', '/var/lib/libvirt/filesystems/mypost/var/spool/postfix/public/qmgr', "[Errno 6] No such device or address:

2. # ll /var/spool/postfix/public/ -a
total 8
drwx--x---.  2 postfix postdrop 4096 Sep  2 11:39 .
drwxr-xr-x. 16 root    root     4096 Sep  2 11:31 ..
srw-rw-rw-.  1 postfix postfix     0 Sep  2 11:39 cleanup
srw-rw-rw-.  1 postfix postfix     0 Sep  2 11:39 flush
srw-rw-rw-.  1 postfix postfix     0 Sep  2 11:39 pickup
srw-rw-rw-.  1 postfix postfix     0 Sep  2 11:39 qmgr
srw-rw-rw-.  1 postfix postfix     0 Sep  2 11:39 showq

3. # virsh -c lxc:/// list --all
 Id    Name                           State

[root@intel-5504-12-1 images]# virt-sandbox-service create -C -u postfix.service mypost
/usr/bin/virt-sandbox-service: /var/lib/libvirt/filesystems/mypost already exists

Actual results:
see description

Expected results:


Additional info:
Comment 2 Daniel Berrange 2013-09-18 07:58:55 EDT
It seems that /var/spool/postfix/public/qmgr is a UNIX socket. Python's shutil.copytree() code just raises an exception if it finds  a UNIX socket or FIFO file, which is less than helpful.
Comment 3 Daniel Berrange 2013-09-18 08:30:48 EDT
commit 45891224a46c13200303a9d100ce1763acfd4509
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Wed Sep 18 13:22:32 2013 +0100

    Stop using broken shutil.copytree() method
    The shutil.copytree() method is broken in several ways
     - Raises exceptions if it sees a socket or fifo
     - Copies block/char device content into plain files
     - Calls stat() far too many times
    Fixing this requires passing a callback to filter the
    file list, which requires more use of stat() making it
    even less efficient.
    Ditch it and write a method that works correctly for
    our needs, skipping block/char/fifo/socket files entirely.
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Comment 5 zhe peng 2013-10-09 05:41:18 EDT
verify with build:

1:# virt-sandbox-service create -C -u postfix.service mypost 
Created sandbox container dir /var/lib/libvirt/filesystems/mypost
Created unit file /etc/systemd/system/mypost_sandbox.service
Created sandbox config /etc/libvirt-sandbox/services/mypost/config/sandbox.cfg

2:# virsh -c lxc:/// start mypost
Domain mypost started

3:# virt-sandbox-service connect mypost
sh-4.2# systemctl status postfix
postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled)
  Drop-In: /etc/systemd/system/postfix.service.d
   Active: active (running) since Wed 2013-10-09 17:37:52 CST; 18s ago
  Process: 20 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS)
  Process: 19 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
  Process: 14 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=0/SUCCESS)
 Main PID: 91 (master)
   CGroup: name=systemd:/system/libvirtd.service/system/postfix.service
           ├─91 /usr/libexec/postfix/master -w
           ├─92 pickup -l -t unix -u
           └─93 qmgr -l -t unix -u
           ‣ 91 /usr/libexec/postfix/master -w

move to verified.
Comment 7 Ludek Smid 2014-06-13 06:10:45 EDT
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.