我試圖在OSX 10.10.4上使用shell腳本啓動與其關聯項目的無臉服務器應用程序。osx startupitems 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>
戈登,你的答案完美無缺! 很少有人給過我發過來的答案。 謝謝! :-) –