简体   繁体   English

如何停止Rails Server(Redmine)?

[英]how to stop rails server (redmine) ?

i've installed and running redmine in my domain. 我已经在我的域中安装并运行了Redmine。 something went wrong and i cant access redmine admin panel. 出现问题,我无法访问Redmine管理面板。 i tried to reset password and also did some google and changed password in database. 我试图重置密码,也做了一些谷歌和更改数据库中的密码。 but no luck still cant login. 但仍然没有运气无法登录。 then i removed all app files but its still running same as before.. 然后我删除了所有应用程序文件,但仍与以前一样运行。

this was the code i used to run redmine server 这是我用来运行Redmine服务器的代码

bundle exec ruby script/rails server webrick -e -s production

now i'm trying to stop or restart but nothing is working. 现在,我正在尝试停止或重新启动,但没有任何反应。

is there any way to stop the server. 有什么办法可以停止服务器。

Thanks in advance. 提前致谢。

Kill the process 杀死进程

kill -INT $(cat tmp/pids/server.pid)

Its cleaner to write a rake task to do that: 它的清洁工编写了一个rake任务来做到这一点:

task :stopserver do
  pid_file = 'tmp/pids/server.pid'
  if File.file?(pid_file)
    print "Shutting down WEBrick\n"
    pid = File.read(pid_file).to_i
    Process.kill "INT", pid
  end
  File.file?(pid_file) && File.delete(pid_file)
end

删除文件tmp/pids/server.pid) ,然后重新启动服务器。

Usually you'll hit Ctrl-C to stop webrick when it's started without -d option. 通常,启动不带-d选项的webrick时,您会按Ctrl-C来停止它。 The Ctrl-C makes INT signal, so youcould try with kill -INT <pid> to stop webrick started with -d option. Ctrl-C发出INT信号,因此您可以尝试使用kill -INT <pid>停止以-d选项开头的webrick。

If it doesn't stop you can try with kill -9 <pid> sending a KILL signal, that's not a proper clean shutdown but seems the only way to stop it. 如果它没有停止,您可以尝试使用kill -9 <pid>发送一个KILL信号,这不是正确的干净关机,但是似乎是停止它的唯一方法。 It's not a 'best practice' but it's the only method i've ever found. 这不是“最佳实践”,但这是我找到的唯一方法。

$ killall -9 ruby

此命令将杀死系统上所有正在运行的ruby实例,您可以再次重新启动ur服务器

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

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