Lasso Soft Inc. > Home

  • Articles

Lasso 8.5 Zombie Child Thread Killer

This routine kills zombie child Lasso sites. The rouge child site tend to randomly appear after running Lasso 8.5 heavily after a few days - they hog unncessary memory.

Warning - Requires RD_lassoService_pid

This script can be run periodically to cull any rouge zombie Lasso sites - tested on OSX. It requires RD_lassoService_pid to be installed within LassoStartup for each LassoSite.

  1. http://tagswap.net/RD_lassoService_pid
  2. Running once per day early morning should suffice.
  3. Remove back slashes from code where noted

Use at your own risk...

#!/bin/sh
# Created By Ke Carlton 2010
# ke * zeroloop.com

echo ""
echo "Lasso Zombie Child Thread Killer"
echo "-----------------------------------"
echo "WARNING: You *must* have installed the LassoServe_pid routine within each LassoSite"
echo "startup folder: http://tagswap.net/RD_lassoService_pid otherwise this rountine"
echo "will simply continuous kill the Lasso sites... "
echo ""

sleep 1 ; echo -n "3...";
sleep 1 ; echo -n "2...";
sleep 1 ; echo -n "1...";
sleep 1 ; echo "!";


index=0
allLassoProcesses=( $( ps -u lasso -o pid,command | grep Lasso | awk '{ print $1}' ) )

# Work of lasso_pid files
for myfile in  /tmp/LassoService8_*.pid
do
        validLassoProcesses[$index]=`cat $myfile`
        index=$(($index+1))
done

echo "allLassoProcesses: ${allLassoProcesses[*]}"
echo "validLassoProcesses: ${validLassoProcesses[*]}"

for pid in "${allLassoProcesses[@]}"
do
 
 valid=0
        for vpid in "${validLassoProcesses[@]}"
        do
                # Remove back slashes below
                if [\[ $vpid = $pid ]\] ; then
                        valid=1
                fi;
        done

        # Remove back slashes below
        if [\[ $valid == 0 ]\] ; then
                echo "Killing PID $pid";
                echo "$pid" | xargs kill
        fi;

done
echo "Done"
echo ""

Author: Ke Carlton
Created: 27 Apr 2010
Last Modified: 16 Mar 2011

Comments

No comments found
You must be logged in to comment.

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft