脚本--Linux下清理IPC资源

Linux 下使用用Tuxedo经常会遇到,can't attach to BB,但相关的Tuxedo Server还在运行,使用tmshutdown -y 和tmipcrm -y  无法停止Tuxedo,这时可以从操作系统层面清除tuxedo使用的IPC资源,从操作系统层面停止Tuxedo;

      脚本内容:

      for x in `ipcs -m | grep $USER|awk '{print $2}'`
              do
                  ipcrm -m $x
              done
      echo "IPC CLEAN: Clean Shared Memory Successfully!"
      for y in `ipcs -s | grep $USER|awk '{print $2}'`
              do
                  ipcrm -s $y
              done
       echo "IPC CLEAN: Clean Semaphore Successfully!"
       for z in `ipcs -q | grep $USER|awk '{print $2}'`
              do
                  ipcrm -q $z
              done
       echo "IPC CLEAN: Clean Message Queue Successfully!"

相关推荐