Mac(satie)のtomcat設定

設定
CATALINA_HOME=/usr/local/tomcat

起動・終了設定

# cd /Library/StartupItems
# mkdir Tomcat
# touch StartupParameters.plist
# touch Tomcat
# chmod +x /Library/StartupItems/Tomcat/Tomcat


StartupParameters.plist

{
Description = "Tomcat Server";
Provides = ("TOMCAT");
OrderPreference = "Early";
Messages =
{
  start = "Starting Tomcat Server";
  stop = "Stopping Tomcat Server";
  restart = "Restarting Tomcat Server";
};
}


Tomcat

#!/bin/sh

export CATALINA_HOME=/usr/local/tomcat
export JAVA_HOME=/Library/Java/Home
. /etc/rc.common

StartService() {
if [ "${TOMCAT:=-NO-}" = "-YES-" ]; then
  ConsoleMessage "Starting Tomcat"
  sudo -u hisaboh $CATALINA_HOME/bin/startup.sh
fi
}

StopService() {
ConsoleMessage "Stopping Tomcat"
sudo -u hisaboh $CATALINA_HOME/bin/shutdown.sh
}

RestartService() {
if [ "${TOMCAT:=-NO-}" = "-YES-" ]; then
  ConsoleMessage "Restart Tomcat"
  sudo -u hisaboh $CATALINA_HOME/bin/shutdown.sh
  sudo -u hisaboh $CATALINA_HOME/bin/startup.sh
else
  StopService
fi
}

RunService "$1"


手動での起動・終了

# SystemStarter start "TOMCAT"
# SystemStarter stop "TOMCAT"


起動設定
/etc/hostconfig

TOMCAT=-YES-

もしくは

TOMCAT=-NO-