1 |
#!/bin/bash -x |
#!/bin/bash |
2 |
|
|
3 |
# based on Tony Risinger code from lxc-users |
# based on Tony Risinger code from lxc-users |
4 |
# http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg00074.html |
# http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg00074.html |
5 |
|
|
6 |
which inotifywait || apt-get install inotify-tools |
which inotifywait >/dev/null || apt-get install inotify-tools |
7 |
|
|
8 |
name=llin |
name=$1 |
9 |
|
|
10 |
#lxc-info -n $name | grep RUNNING && exit |
if [ ! -e /var/lib/lxc/$name/config ] ; then |
11 |
|
echo "Usage: $0 name" |
12 |
|
ls /var/lib/lxc/*/config | cut -d/ -f5 |
13 |
|
exit 1 |
14 |
|
fi |
15 |
|
|
16 |
rootfs=`grep lxc.rootfs /var/lib/lxc/$name/config | cut -d= -f2` |
rootfs=`grep lxc.rootfs /var/lib/lxc/$name/config | cut -d= -f2` |
17 |
echo "$name rootfs $rootfs" |
echo "$name rootfs $rootfs" |
18 |
|
|
19 |
# fix lxc-stop which remounts ro |
lxc-info -n $name | grep RUNNING || lxc-start -d -n $name -o /tmp/${name}.log && echo "$name start" |
|
mount /mnt/llin -o remount,rw |
|
|
|
|
|
lxc-start -d -n $name -o /tmp/${name}.log |
|
20 |
|
|
21 |
while true; do |
while true; do |
22 |
# time of 5 minutes on it JUST IN CASE... |
# time of 5 minutes on it JUST IN CASE... |