stevecopley
Registered
Hi...
I've been playing with my Hosts file to block ad sites and also installed the eDexterJavaDog to return a blank gif when webpages request ad graphics (prevents browser hanging for blocked ads and showing 404 errors). My hosts file is now huge, ads are blocked, life is good... Except...
I've attempted to get the java file to run at startup. The script is shown below along with the .plist file. Its starts ok, but when I try to logout, OS X hangs waiting for the java process to stop. I have to manually force-quit the process to complete the logout. The 'case' in the script is my attempt to overcome this (I had read somewhere that the OS sends 'stop' to the script when terminating process - I think this could be wrong though!)
So, my questions...
1. Why is the OS hanging? Why doesn't the java process just die when it's told to!
2. What can I do about it?!
Any help greatly appreciated!
Steve
/Library/StartupItems/eDexter/eDexter script...
/Library/StartupItems/eDexter/StartupParameters.plist file...
I've been playing with my Hosts file to block ad sites and also installed the eDexterJavaDog to return a blank gif when webpages request ad graphics (prevents browser hanging for blocked ads and showing 404 errors). My hosts file is now huge, ads are blocked, life is good... Except...
I've attempted to get the java file to run at startup. The script is shown below along with the .plist file. Its starts ok, but when I try to logout, OS X hangs waiting for the java process to stop. I have to manually force-quit the process to complete the logout. The 'case' in the script is my attempt to overcome this (I had read somewhere that the OS sends 'stop' to the script when terminating process - I think this could be wrong though!)
So, my questions...
1. Why is the OS hanging? Why doesn't the java process just die when it's told to!
2. What can I do about it?!

Any help greatly appreciated!
Steve
/Library/StartupItems/eDexter/eDexter script...
Code:
#!/bin/sh
. /etc/rc.common
case $1 in
start)
ConsoleMessage "Starting eDexter"
java -jar /Applications/Network/eDexterJavaDog/eDexterJavaDog.jar &
;;
stop)
if pid=`ps auxc | grep java | awk '{ print $2 } '`; then
ConsoleMessage "Stopping eDexter"
ConsoleMessage "Process ${pid}"
kill -TERM "${pid}"
else
echo "eDexter is not running."
fi
;;
*)
echo "$0: unknown argument: $1"
;;
esac
/Library/StartupItems/eDexter/StartupParameters.plist file...
Code:
{
Description = "eDexter";
Provides = ("eDexter");
OrderPreference = "None";
Messages =
{
start = "Starting eDexter";
stop = "Stopping eDexter";
};
}