2014-06-27 48 views
2

當我嘗試將獨立實例升級到新版本時,經常遇到此問題,它易於解決手動創建pid文件的問題。 但是在這個時候安裝新版本0.14.0,我做了我所知道的所有事情,即使是乾淨的安裝,這個「步驟」也不起作用。也許yum update命令應該提供新的更新。嘗試啓動Contextbroker作爲系統服務時未找到Pidfile

[[email protected]~]# /etc/init.d/contextBroker start 
Starting... 
contextBroker is stopped 
Starting contextBroker...       cat: /var/log/contextBroker/contextBroker.pid: No such file or directory 
pidfile not found           [FAILED] 

當我在FG(contextBroker -fg)中運行它時,它的工作正常,這就是使用它的方式。

這是我curl localhost:1026/version輸出:

<orion> 
    <version>0.14.0</version> 
    <uptime>0 d, 0 h, 1 m, 59 s</uptime> 
    <git_hash>5e3d210e4b15fa9ebbfa07c93dd41f8b41697d0e</git_hash> 
    <compile_time>nodate</compile_time> 
    <compiled_by>fermin</compiled_by> 
    <compiled_in>centollo</compiled_in> 
</orion> 

Addictionaly這是我的MD5校驗輸出:

[[email protected]~]# md5sum /usr/bin/contextBroker 
d3f24c4670a9d25a22c8877c3cdcc2b4 /usr/bin/contextBroker 

我該如何解決呢?

+0

只是拋棄問題在/etc/init.d/contextBroker腳本或在CB本身,你可以編輯你的問題,以告訴如果在前臺運行CB的作品,請?即在shell終端運行'contextBroker -fg',然後在另一個shell中執行'curl localhost:1026/version'。 – fgalan

+0

已編輯! 所以它的工作如前所述。 – LeonanCarvalho

+0

重新啓動後,即可恢復工作。我無法重新創建這種情況,並調試在第一次啓動contextBroker服務時缺少pid文件的原因。 – LeonanCarvalho

回答

2

似乎如果由於任何原因(例如,在某些更新中)PID文件不存在或其內容與內存中運行的進程的實際PID不一致,則/etc/init.d/contextBroker服務腳本可能無法停止經紀人。

因此,你可以應用以下過程:

  1. 檢查已經有運行的現有contextBroker過程。
  2. 這一進程不會停止後/etc/init.d/contextBroker stop/etc/init.d/contextBroker restart
  3. 獲取進程的PID(提示:使用ps ax | grep contextBroker),然後kill對PID

殺死該進程後,/etc/init.d/contextBroker start應該重新工作。

感謝Massimiliano Nigrelli在他的團隊幫助調試此問題。

相關問題