我正在尝试使用 OSX 10.10.4 上的 shell 脚本启动一个不露面的服务器应用程序及其相关项目。
shell 脚本已设置为可执行。
在启动时,启动 Wakanda\ Server.app/Contents/MacOS/Wakanda\ Server 没有任何反应。
请帮我完成这项工作。
shell 脚本位于:
Macintosh HD:Library:StartupItems:DispatchStartup:DispatchStartup.sh
这个shell脚本的内容是:
#!/bin/sh
. /etc/rc.common
# The start subroutine
StartService() {
# Insert your start command below. For example:
/Applications/Wakanda\ Server.app/Contents/MacOS/Wakanda\ Server --solution=/Applications/Dispatch/Dispatch\ Solution/Dispatch.waSolution
# End example.
}
# The stop subroutine
StopService() {
# Insert your stop command(s) below. For example:
killall -TERM /Applications/Wakanda\ Server.app/Contents/MacOS/Wakanda\ Server
sleep 15
killall -9 /Applications/Wakanda\ Server.app/Contents/MacOS/Wakanda\ Server
# End example.
}
# The restart subroutine
RestartService() {
# Insert your start command below. For example:
killall -HUP /Applications/Wakanda\ Server.app/Contents/MacOS/Wakanda\ Server
# End example.
}
RunService "$1"
//------------------------------------------------ ------------------
// shell 脚本旁边是 StartParameters.plist //------------------------- -------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>Description</key>
<string>Wakanda Server</string>
<key>OrderPreference</key>
<string>Late</string>
<key>Provides</key>
<array>
<string>Web service to database and objects</string>
</array>
<key>Uses</key>
<array>
<string>Network</string>
</array>
</dict>
</plist>