简体   繁体   English

关闭 powershell 后服务停止

[英]service stops after closing powershell

I'm running a command in powershell我在 powershell 中运行命令

blockchain-wallet-service start  --port 3000

output looks like this output 看起来像这样

159243453597 - info: blockchain.info wallet service v0.26.3 running on http://127.0.0.1:3000

which occupies cli and prevents from running other commands after.它占用 cli 并阻止之后运行其他命令。 I created a new windows service using New-Service and it autostarts on reboot.我使用New-Service创建了一个新的 windows 服务,它会在重新启动时自动启动。 BUT it doesn't respond to windows after it starts and windows shuts it down since it thinks it's dead.但是它在启动后没有响应 windows 并且 windows 将其关闭,因为它认为它已经死了。 But it actually works the problem is the output.但它实际上工作的问题是output。 it just stays on它只是停留在

info: blockchain.info wallet service v0.26.3 running on http://127.0.0.1:3000

Forever.永远。 How do I go around it?我怎么绕go呢?

Installed service using NSSM.使用 NSSM 安装服务。

Powershell_script.ps1 Powershell_script.ps1

$serviceName = 'MyService'
nssm install $serviceName "C:\Users\Administrator\AppData\Roaming\npm\blockchain-wallet-service.cmd" "start"
nssm status $serviceName
Start-Service $serviceName
Get-Service $serviceName

Documentation used: git.nssm gist.nssm nssm.cc使用的文档: git.nssm gist.nssm nssm.cc

PS Unfortunately I couldn't install it using New-Service option, as blockchain-wallet-service never response back to the windows service as I understood... PS 不幸的是,我无法使用New-Service选项安装它,因为据我所知,blockchain-wallet-service 永远不会响应 windows 服务......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM