RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 921940 - virt-sandbox-service wrongly assume /var/log/journal exists
Summary: virt-sandbox-service wrongly assume /var/log/journal exists
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt-sandbox
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-15 10:13 UTC by Monson Shao
Modified: 2019-02-14 02:22 UTC (History)
5 users (show)

Fixed In Version: libvirt-sandbox-0.2.0-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 10:03:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Monson Shao 2013-03-15 10:13:38 UTC
Description of problem:

In virt-sandbox-service: Container.gen_machine_id():

330        journalfile = "/var/log/journal/" + uuid                   
331        fd=open(self.dest + journalfile, "w")                             
332        fd.close()                                                        
333        os.symlink(self.dest + journalfile, journalfile)                 
334                                                                          
335    def __gen_filesystems(self):                                          
336        if self.use_image:                                                          

It assumes that /var/log/journal/ exists.
But according to journald.conf(5), missing /var/log/journal is allowed.
Actually, that directory won't be created by default and is shipped with no packages.

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

How reproducible:
100%

Steps to Reproduce:
run virt-sandbox-service while /var/log/journal/ doesn't exist.
  
Actual results:
virt-sandbox-service exit halfway and print:
/usr/bin/virt-sandbox-service: [Errno 2] No such file or directory

Expected results:
   a) create /var/log/journal/ automatically
or b) don't create the symbol link
Anyway, virt-sandbox-service should not die of non-fatal exception.

Comment 2 Daniel Berrangé 2013-03-20 16:12:32 UTC
commit 6b8a314f58e1678a4ba419aaa17c88145a7a5105
Author: Daniel P. Berrange <berrange>
Date:   Wed Mar 20 16:08:55 2013 +0000

    Don't assume /var/log/journal exists
    
    When creating the journal symlink, create /var/log/journal if
    it does not already exist. Also handle fact that the journal
    symlink might have been removed, when deleting a sandbox.

Comment 3 dyuan 2013-03-22 02:57:04 UTC
When I upgrade systemd to systemd-198-4.el7, the /var/log/journal will created by default. But it's still necessary to determine whether folder exists or not.

Comment 4 Wayne Sun 2013-07-18 07:57:13 UTC
pkgs:
libvirt-1.1.0-2.el7.x86_64
libvirt-sandbox-0.2.1-1.el7.x86_64
kernel-3.9.0-0.55.el7.x86_64
systemd-204-4.el7.x86_64

steps:
1. move journal dir
# mv /var/log/journal/ /tmp

2. create a container
# virt-sandbox-service -c lxc:/// create -C -u httpd.service -s static,label=system_u:system_r:svirt_lxc_net_t:s0:c11,c221 -N dhcp,source=default apache2
Created sandbox container dir /var/lib/libvirt/filesystems/apache2
Created unit file /etc/systemd/system/apache2_sandbox.service
Created sandbox config /etc/libvirt-sandbox/services/apache2.sandbox

3. check journal dir
# ll /var/log/journal -d
drwxr-xr-x. 2 root root 4096 Jul 18 15:51 /var/log/journal

# ll /var/log/journal
total 4
lrwxrwxrwx. 1 root root 85 Jul 18 15:51 2739e363fa6c4b2396b43e32608b2337 -> /var/lib/libvirt/filesystems/apache2/var/log/journal/2739e363fa6c4b2396b43e32608b2337

4. delete a container
# rm -rf /var/log/journal/2739e363fa6c4b2396b43e32608b2337/
# virt-sandbox-service delete apache2
# echo $?
0

and delete with domain uuid journal dir exist also success, so this is fixed.

Comment 6 Ludek Smid 2014-06-13 10:03:08 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.