Fix relative path bug in delete_site kill commands

This commit is contained in:
rulingcom 2026-07-24 14:44:41 +08:00
parent 885493a7d1
commit a2af91f97e
1 changed files with 3 additions and 3 deletions

View File

@ -24,8 +24,8 @@ namespace :create_site do
if @site_construct.status != "closed"
update_infos("Closing site #{@site_construct.site_name}...")
end
exec_ssh_command_by_sudo(ssh,"kill -s TERM `cat tmp/pids/unicorn.pid`")
exec_ssh_command_by_sudo(ssh,"kill -s TERM `fuser tmp/unicorn.sock`")
exec_ssh_command_by_sudo(ssh,"kill -s TERM `cat #{@site_construct.path}/#{@site_construct.get_site_name}/tmp/pids/unicorn.pid 2>/dev/null`")
exec_ssh_command_by_sudo(ssh,"kill -s TERM `fuser #{@site_construct.path}/#{@site_construct.get_site_name}/tmp/unicorn.sock 2>/dev/null`")
update_infos("Deleting database for #{@site_construct.site_name}")
db_name = exec_ssh_command_by_sudo(ssh,"echo `cat #{@site_construct.path}/#{@site_construct.get_site_name}/config/mongoid.yml | grep 'database'`").split("database:").last.strip
exec_ssh_command_by_sudo(ssh,"bash -l -c 'echo \"db.dropDatabase()\" | mongo --shell \'#{db_name}\''")
@ -59,4 +59,4 @@ namespace :create_site do
@site_construct.save!
return @site_construct.infos
end
end
end