A good guide is available here
File: /Library/StartupItems/RRiki/StartupParameters.plist:
File: /Library/StartupItems/RRiki/RRiki
To manipulate the service:
File: /Library/StartupItems/RRiki/StartupParameters.plist:
{
Description = "RRiki server";
Provides = ("RRiki");
Uses = ("Ruby");
OrderPreference = "Last";
Messages =
{
start = "Starting RRiki server";
stop = "Stopping RRiki server";
restart = "Restarting RRiki server";
};
}
File: /Library/StartupItems/RRiki/RRiki
#!/bin/sh
##
# RRiki service startup script
##
. /etc/rc.common
StartService ()
{
ConsoleMessage "Starting RRiki"
cd /Users/kghose/Source/Rriki2/
/usr/local/bin/thin start -eproduction -d
}
StopService ()
{
ConsoleMessage "Stopping RRiki"
cd /Users/kghose/Source/Rriki2/
/usr/local/bin/thin stop
}
RestartService ()
{
ConsoleMessage "Restarting RRiki"
cd /Users/kghose/Source/Rriki2/
/usr/local/bin/thin restart -eproduction -d
}
RunService "$1"
To manipulate the service:
sudo SystemStarter restart RRiki
Comments
Post a Comment