55 |
|
|
56 |
lxc_status() { |
lxc_status() { |
57 |
( find /var/lib/lxc/ -name "config" | cut -d/ -f5 | sort -u | while read name ; do |
( find /var/lib/lxc/ -name "config" | cut -d/ -f5 | sort -u | while read name ; do |
58 |
status=`lxc-info -n $name 2>/dev/null | grep state: | cut -d: -f2` |
status=`lxc-info -n $name 2>/dev/null | grep state: | cut -d: -f2` # 0.7.5 |
59 |
|
test -z "$status" && status=`lxc-info -n $name | sed -e 's/^.* is //'` # 0.7.2 |
60 |
boot="-" |
boot="-" |
61 |
test -s /var/lib/lxc/$name/on_boot && boot="boot" |
test -s /var/lib/lxc/$name/on_boot && boot="boot" |
62 |
echo "$name $status $boot $(lxc_rootfs $name) $(lxc_ip $name) $(lxc_hostname $name)" |
echo "$name $status $boot $(lxc_rootfs $name) $(lxc_ip $name) $(lxc_hostname $name)" |
106 |
name=$1 |
name=$1 |
107 |
sig=$2 |
sig=$2 |
108 |
|
|
109 |
init_pid=`lxc-ps -C init -o pid | grep "^$name" | cut -d" " -f2-` |
ver=`lxc-version | cut -d: -f2 | sed 's/\.//g'` |
110 |
|
opts='' |
111 |
|
test $ver -ge 075 && opts='--' |
112 |
|
|
113 |
|
init_pid=`lxc-ps $opts -C init -o pid | grep "^$name" | cut -d" " -f2-` |
114 |
if [ -z "$init_pid" ] ; then |
if [ -z "$init_pid" ] ; then |
115 |
lxc-info -n $name |
lxc-info -n $name |
116 |
exit 1 |
exit 1 |