我對Solaris SMF來說確實是一個新手,並且正在爲Weblogic Nodemanager編寫一個SMF。我遵循以下步驟: http://www.camelrichard.org/controlling-weblogic-node-manager-solaris-smf-non-root爲什麼solaris smf給出「方法或服務退出超時」,即使該方法退出狀態爲0
要測試SMF是否在服務被重新啓動時重新啓動服務,我將從另一個終端發送一個終止信號,但它不會重新啓動。這是日誌文件說:
[ Nov 19 10:17:39 Stopping because process received fatal signal from outside the service. ]
Killed
+ set +x
[ Nov 19 10:17:39 Executing stop method ("/usr/local/Oracle/Middleware/wlserver_10.3/server/bin/killNodeManager.sh") ]
Trying to find the PID of the nodeManager process
Cannot find the PID, NodeManager is not running - cannot kill
[ Nov 19 10:17:39 Method "stop" exited with status 0 ]
[ Nov 19 10:18:40 Method or service exit timed out. Killing contract 100 ]
什麼我不明白,如果你看一下最後兩行,第一個說的方法退出,而第二個說的方法超時是。我覺得很奇怪。任何人都知道這裏發生了什麼?該SMF的相關部分如下:
<service_bundle type='manifest' name='nodemanager'>
<service name='application/management/nodemanager' type='service' version='1'>
<single_instance />
<dependency
name='multi-user-server'
grouping='require_all'
restart_on='error'
type='service'>
<service_fmri value='svc:/milestone/multi-user-server' />
</dependency>
<exec_method
type='method'
name='start'
exec='/usr/local/Oracle/Middleware/wlserver_10.3/server/bin/startNodeManager2.sh'
timeout_seconds='120' >
<!-- Trying as root for now :
<method_context>
<method_credential user='weblogic' group='weblogic' />
</method_context>
-->
</exec_method>
<exec_method
type='method'
name='stop'
exec='/usr/local/Oracle/Middleware/wlserver_10.3/server/bin/killNodeManager.sh'
timeout_seconds='60' />
對不起,對於遲到的回覆,我認爲返回狀態爲0的消息是我們的NodeManager以維護模式結束的原因。我們發現,如果Nodemanager首先關閉而不關閉weblogic,則很多時候NodeManager進入維護模式。但是,如果我們執行了'svcadm disable weblogic',然後是'svcadm disable nodemanager',那麼NodeManager不會進行維護。 此外,顯然SMF說退出狀態),即使我返回SMF_EXIT_OK – Jatin 2012-03-26 20:50:19