ocf RA for lxc doesn't work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
resource-agents (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Precise |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
The OCF RA for LXC-Containers does not work as expected - better to say: it does not work at all.
This is caused by some mistakes within /usr/lib/
1. LXC_status expects not the output lxc-info provides, fixed in line 244 by:
if [[ "$S" =~ "RUNNING" ]] ; then
2. lxc-ps expects the ps-options not directly but seperated by -- in lines 194, 201
lxc-ps -- -C ...
this will work correctly as far as I've tested for now.
regards,
max
version-
resource-agents:
Installed: 1:3.9.2-5ubuntu4
Candidate: 1:3.9.2-5ubuntu4
lxc:
Installed: 0.7.5-3ubuntu53
Candidate: 0.7.5-3ubuntu53
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
Hello,
I can confirm the bug.
The latest GIT version has already fixed that: /raw.github. com/ClusterLabs /resource- agents/ master/ heartbeat/ lxc
https:/
Here is the diff:
--- lxc.orig 2012-04-17 00:23:21.000000000 +0200
+++ lxc 2012-05-15 19:13:37.882415213 +0200
@@ -239,7 +239,10 @@
}
LXC_status() { container} ` container} ` container} : $S"
- S=`lxc-info -n ${OCF_RESKEY_
+ # run lxc-info with -s option for LXC-0.7.5 or later
+ local lxc_info_opt="-s"
+ ocf_version_cmp "`lxc-version | cut -d' ' -f 3`" 0.7.5 && lxc_info_opt=""
+ S=`lxc-info $lxc_info_opt -n ${OCF_RESKEY_
ocf_log debug "State of ${OCF_RESKEY_
if [[ "${S##* }" = "RUNNING" ]] ; then
return $OCF_SUCCESS
Please push to upstream!
Thank you,
Christoph