安裝Service服務啟動報“service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.”解決方案

問題

早上使用SC命令部署Service,啟動服務一直報The **** service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

換成Install.bat又報“The service did not report an error.More help is available by typing NET HELPMSG 3534.”

終于在各種查資料后,得到了解決。

解決步驟

step1, 快捷鍵Windows + R 打開Run。

Step2. 輸入eventvwr.msc ,回車,打開 Event Viewer。

Step3. 點擊Windows Log -> Application 查找對應的Service的Error log查看詳情。

Step4.根據(jù)log,定位問題。

我的Application 日志顯示如下:

根據(jù)log文件,可見是因為路徑的問題。

分析:因為Service啟動需要向指定磁盤寫內(nèi)容如log,我本機環(huán)境沒有D盤,但是Service的Condig文件中配置的是向D盤寫。這就導致它找到D盤,無法寫成功從而啟動失敗。最終將路徑指向了其他盤,Service啟動成功。

最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容