Create your own apple startupitems
$> mkdir Tomcat
$> cd Tomcat
$> cp /System/Library/StartupItems/Apache/Apache ./Tomcat
$> cp /System/Library/StartupItems/Apache/StartupParameters.plist .
$> vi StartupParameters.plist
{
Description = "Tomcat servlet engine";
Provides = ("Servlet Engine");
Requires = ("DirectoryServices");
Uses = ("NFS");
OrderPreference = "None";
}
$> vi Tomcat
#!/bin/sh
##
# Tomcat Servlet Engine
##
. /etc/rc.common
StartService ()
{
ConsoleMessage "Starting Tomcat"
/usr/local/jakarta-tomcat-4.1.18/bin/startup.sh
}
StopService ()
{
ConsoleMessage "Stopping Tomcat"
/usr/local/jakarta-tomcat-4.1.18/bin/shutdown.sh
}
RestartService ()
{
ConsoleMessage "Restarting Tomcat"
/usr/local/jakarta-tomcat-4.1.18/bin/shutdown.sh
/usr/local/jakarta-tomcat-4.1.18/bin/startup.sh
}
JAVA_HOME=/Library/Java/Home; export JAVA_HOME
RunService "$1"
$> mv Tomcat /Library/StartupItems/
reboot and accept the chmod of Tomcat, reboot again.
Reference:
http://www.oreilly.com/pub/a/mac/2003/10/21/startup.html
No comments :
Post a Comment