#
# based on Tony Risinger post to lxc-users mailing list
# http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg00074.html
+#
+# Install with:
+# ln -sf /srv/sysadmin-cookbook/recepies/lxc/lxc-watchdog.sh /etc/init.d/lxc-watchdog
+# update-rc.d lxc-watchdog defaults
which inotifywait >/dev/null || apt-get install inotify-tools
}
+usage() {
+ echo "Usage: $0 {start|stop|restart|status|boot|disable} [name name ... ]" >&2
+ exit 3
+}
+
command_on_lxc() {
command=$1
shift
echo -n > /var/lib/lxc/$1/on_boot
;;
*)
- echo "Usage: $0 {start|stop|restart|status}" >&2
- exit 3
+ usage
;;
esac
}
command=$1
-shift
-
+test -z "$command" && usage
test "$command" = "status" && lxc_status && exit
+shift
if [ -z "$1" ] ; then
ls /var/lib/lxc/*/on_boot | while read path ; do