在 os x 上停止 hg 服务

发布于 2024-10-05 17:57:50 字数 295 浏览 0 评论 0原文

如何在 OS X(服务器 10.6)中停止 hg 服务?

我从终端启动它,而不是以守护进程模式启动它。它工作得很好,然后我想做一些改变,所以我按 ctrl-Z 来停止它。当我尝试再次启动它时,它说...

abort: cannot start server at ':8000': Address already in use

我假设该进程已经在运行并且尚未释放端口。但在活动监视器中,我找不到要杀死的“服务”或“hg”或“mercurial”进程。

帮助?

How do I stop hg serve in OS X (server 10.6)?

I started it from the terminal not in daemon mode. It worked fine, then I wanted to make some changes, so I did ctrl-Z to stop it. When I tried to start it again, it says...

abort: cannot start server at ':8000': Address already in use

I assume the process is already running and hasn't let go of the port. But in the activity monitor I can't find and "serve" or "hg" or "mercurial" processes to kill.

Help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦幻之岛 2024-10-12 17:57:50

执行以下操作找出进程 ID:

hgt $ ps -eaf | grep hg
  502 91004 90841   0   0:00.04 ttys007    0:00.11 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python /opt/local/bin/hg serve
  502 91032 90841   0   0:00.00 ttys007    0:00.00 grep hg

终止进程

kill -9 91004

下次使用 Ctrl-C 停止服务器。 :)

Do the following to find out the process id:

hgt $ ps -eaf | grep hg
  502 91004 90841   0   0:00.04 ttys007    0:00.11 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python /opt/local/bin/hg serve
  502 91032 90841   0   0:00.00 ttys007    0:00.00 grep hg

Kill the process

kill -9 91004

Next time use Ctrl-C to stop the server. :)

三月梨花 2024-10-12 17:57:50

Ctrl-Z 暂时停止进程。如果您使用 Ctrl-Z 停止某些操作,您可以通过运行 fg 再次启动它,让它再次接管终端,或者运行 bg 来重新启动它。让它在终端后台运行。否则,您可以使用 pyfunc 的答案来终止服务器。当然,您可以通过在浏览器中打开 localhost:8000 来判断服务器是否仍在工作。

Ctrl-Z stops a process temporarily. If you stop something with Ctrl-Z, you can start it again by running fg to have it take over the terminal again, or bg to have it running in the background of the terminal. Otherwise, you can kill the server using pyfunc's answer. You can tell if the server is still working by opening up localhost:8000 in your browser, of course.

浊酒尽余欢 2024-10-12 17:57:50

检查 hg 服务器的监听端口通常为 8000

sudo lsof -i -n -P | sudo lsof -i -n -P | sudo lsof -i -n -P | grep 听 | grep 8000

检查 hg 的 PID 搜索 hg,然后搜索 python

ps -aef | grep 汞 | grep 蟒蛇 | awk '{print $2}'

现在杀死你找到的 PID

sudo kill -9 `ps -aef | grep 汞 | grep 蟒蛇 | awk '{print $2}'`

Check for the listening port typically 8000 for hg server

sudo lsof -i -n -P | grep LISTEN | grep 8000

Check the PID for hg search for hg and then python

ps -aef | grep hg | grep python | awk '{print $2}'

Now kill the PID you found

sudo kill -9 `ps -aef | grep hg | grep python | awk '{print $2}'`

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文