/[sysadmin-cookbook]/recepies/lxc/lxc-watchdog.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /recepies/lxc/lxc-watchdog.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 181 by dpavlin, Tue Mar 16 17:39:28 2010 UTC revision 182 by dpavlin, Tue Mar 16 17:46:32 2010 UTC
# Line 91  name=$1 Line 91  name=$1
91  rootfs=$(lxc_rootfs $1)  rootfs=$(lxc_rootfs $1)
92    
93  while true; do  while true; do
         # time of 5 minutes on it JUST IN CASE...  
94          vps_utmp=${rootfs}/var/run/utmp          vps_utmp=${rootfs}/var/run/utmp
         inotifywait -qqt 300 ${vps_utmp}  
95          tasks=`wc -l < /cgroup/${name}/tasks`          tasks=`wc -l < /cgroup/${name}/tasks`
96          test -z "$tasks" && exit 1          test -z "$tasks" && exit 1
97          if [ "$tasks" -eq 1 ]; then          if [ "$tasks" -eq 1 ]; then
# Line 126  while true; do Line 124  while true; do
124          else          else
125                  echo "# $name $tasks tasks"                  echo "# $name $tasks tasks"
126          fi          fi
127    
128            # time of 5 minutes on it JUST IN CASE...
129            inotifywait -qqt 300 ${vps_utmp}
130  done  done
131    
132  echo "${name} exited"  echo "${name} exited"

Legend:
Removed from v.181  
changed lines
  Added in v.182

  ViewVC Help
Powered by ViewVC 1.1.26