+++ This bug was initially created as a clone of Bug #888871 +++ [3] What is the nature and description of the request? /usr/share/rhn/virtualization/poller.py (run as a cron job) provided by package="rhn-virtualization-host" generates tracebacks (like below) without checking the status of libvirtd. ____________________________ libvir: RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock-ro': No such file or directory Warning: Could not retrieve virtualization information! libvirtd service needs to be running. libvir: RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock-ro': No such file or directory Traceback (most recent call last): File "<stdin>", line 301, in <module> File "/usr/share/rhn/virtualization/domain_directory.py", line 70, in __init__ self.conn = libvirt.openReadOnly(None) File "/usr/lib64/python2.6/site-packages/libvirt.py", line 247, in openReadOnly if ret is None:raise libvirtError('virConnectOpenReadOnly() failed') libvirt.libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock-ro': No such file or directory ____________________________ Which is annoying. [4] Why does the customer need this? (List the business requirements here) Customer does not want unwanted tracebacks to be sent as mails - even when libvirtd is running. The following is *un-acceptable* to the customer. In /etc/cron.d/rhn-virtualization.cron : ====== 0-59/2 * * * * root python < /usr/share/rhn/virtualization/poller.py &> /dev/null ====== This was not be acceptable to them as only the poller.py traces are directed to /dev/null There exists no easy way for their support-team to get notified if libvirtd crashes/is stopped or something else (since poller.py depends upon libvirtd) but they require the libvirtd crashes *also* be reported to them via mails This is easier for their SUPPORT team to read and get notified about. [5] How would the customer like to achieve this? (List the functional requirements here) - The poller.py should check the status of the libvirtd and only execute when it finds that libvirtd is stopped. - The cron-job "/etc/cron.d/rhn-virtualization.cron" should be modified to execute in such a way that the poller.py comes into action only when libvirtd is detected as stopped. [8] List any affected packages or components: rhn-virtualization-host [10] Additional Note: The following solution was *acceptable* to the customer. Modify /etc/cron.d/rhn-virtualization.cron as below in the next release version of "rhn-virtualization-host" like below ===== 0-59/2 * * * * root [ -S /var/run/libvirt/libvirt-sock-ro ] && python < /usr/share/rhn/virtualization/poller.py ===== - Addition of "[ -S /var/run/libvirt/libvirt-sock-ro ] &&" will check libvirtd service is running or not. - If running will execute poller.py, otherwise skip it from running. The advantage of this check is that, it will prevent poller.py from executing (if libvirtd service is stopped) and hence prevents the tracebacks generated due to libvirtd not running. At the same time will capture the error message generated by the poller.py script when libvirtd is running.
The description above is a bit confusing, however the root problem is that if the server has both libvirt and rhn-virtualization-host installed and libvirtd is not running, the root user is spammed with email every two minutes from rhn-virtualization-host's cron job telling him that libvirtd is not running. It is not rhn-virtualization-host's job to tell root that libvirtd is not running; the cron job should just exit silently in that case.
Committing to Spacewalk master: f8a772a3fc72941210a4110c57785d01cab5462d
And commit: 803852b36c12a3585ce3ca25d408236be218d773
And commit: 3fc294d07efb635f773ad8efbce654996eb63d63
Spacewalk 2.2 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes22