Skip to content

Commit

Permalink
lxc-kill-all to .. kill all vms
Browse files Browse the repository at this point in the history
  • Loading branch information
niklas committed Aug 27, 2010
1 parent 74cbc96 commit f484da3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recipes/default.rb
Expand Up @@ -86,6 +86,13 @@
group 'root'
end

template '/usr/bin/lxc-kill-all' do
source 'tools/lxc-kill-all.erb'
mode '0755'
owner 'root'
group 'root'
end

template '/etc/init/lxc.conf' do
source 'init-lxc.conf.erb'
mode '0644'
Expand Down
10 changes: 10 additions & 0 deletions templates/default/tools/lxc-kill-all.erb
@@ -0,0 +1,10 @@
#! /bin/bash
# lxc-stop-all
# Stop all containers violently.
# please run this only if no machine is responding or their state is frakked up

lxc-ps -C init -opid |while read VM PID ;do
[[ $PID -gt 1 ]] || continue
echo -n " $VM"
lxc-stop -n $VM
done

0 comments on commit f484da3

Please sign in to comment.