Bug 994311 - logrotate fail as list command not exist
logrotate fail as list command not exist
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt-sandbox (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Daniel Berrange
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-06 23:10 EDT by Wayne Sun
Modified: 2014-06-13 07:16 EDT (History)
4 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Wayne Sun 2013-08-06 23:10:36 EDT
Description of problem:

Failed to issue method call: Access denied
/etc/cron.daily/virt-sandbox-service.logrotate:

usage: virt-sandbox-service [-h] [-c URI]
                            
                            {create,clone,connect,delete,execute,reload,upgrade}
                            ...
virt-sandbox-service: error: invalid choice: 'list' (choose from 'create', 'clone', 'connect', 'delete', 'execute', 'reload', 'upgrade')


Version-Release number of selected component (if applicable):
libvirt-1.1.1-2.el7.x86_64
libvirt-sandbox-0.5.0-1.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. cron job created after install libvirt-sandbox
2.
3.

Actual results:
logrotate cron job fail

Expected results:
success

Additional info:
# vim bin/virt-sandbox-service.logrotate
#!/bin/sh
for i in `/usr/bin/virt-sandbox-service list --running`; do
    /usr/bin/virt-sandbox-service execute $i -- /etc/cron.daily/logrotate
done
exit 0

list is removed, so need to change to use virsh -c lxc:/// list, but the running lxc domain created not by virt-sandbox-service also will execute logrotate.
Comment 2 Alex Jia 2013-08-06 23:31:29 EDT
(In reply to Wayne Sun from comment #0)
> list is removed, so need to change to use virsh -c lxc:/// list, but the
> running lxc domain created not by virt-sandbox-service also will execute
> logrotate.

Yes, this need to be changed based on latest codes, it may be a painful thing to crossover control container between libvirt(virsh) and libvirt-sandbox(virt-sandbox-service/virt-sandbox).
Comment 3 Daniel Berrange 2013-08-13 12:46:24 EDT
commit 828f4dec9310a742ccd50aa808eb96cd06ae03fa
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Tue Aug 13 17:44:21 2013 +0100

    Fix logrotate script to use virsh list
Comment 4 zhe peng 2013-08-21 07:27:47 EDT
Can reproduce this with:libvirt-sandbox-0.5.0-2.el7.x86_64

verify with libvirt-sandbox-0.5.0-3.el7.x86_64

step:
1.cron job created after install libvirt-sandbox
# sh /etc/cron.daily/virt-sandbox-service.logrotate 

[root@ibm-x3850x5-04 /]# echo $?
0

2.#virt-sandbox-service connect $guest
sh-4.2# sh /etc/cron.daily/logrotate 
sh-4.2# 

verification passed. move to verified.
Comment 6 Ludek Smid 2014-06-13 07:16:38 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.