我有一个Rails应用程序通过Capistrano部署到Ubuntu 14.04 Amazon EC2实例,然后通过标准的“upstart”服务启动Unicorn服务器。
public void callAsyncRequest(View v) {
new HttpAsyncTask().execute("someUrl.com");
作为测试,我以用户# Upstart Configuration
description "Outright Mental Shop Webservice"
author "Outright Mental Inc."
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
respawn
script
cd /home/sh0/app/current/api
exec su -s /bin/sh -c 'exec "$0" "$@"' sh0 -- unicorn -c config/unicorn.rb
end script
ssh进入该计算机,并在上面的upstart配置文件的sh0
块中运行确切的命令。我的script
看起来不错:
tail -f /home/sh0/app/shared/log/unicorn.stderr.log
但是当我尝试I, [2015-05-16T00:15:36.966576 #2803] INFO -- : Refreshing Gem list
I, [2015-05-16T00:15:38.320758 #2803] INFO -- : unlinking existing socket=/home/sh0/app/shared/.unicorn.sock
I, [2015-05-16T00:15:38.321051 #2803] INFO -- : listening on addr=/home/sh0/app/shared/.unicorn.sock fd=10
I, [2015-05-16T00:15:38.321385 #2803] INFO -- : listening on addr=0.0.0.0:8080 fd=11
I, [2015-05-16T00:15:38.367685 #2808] INFO -- : worker=1 ready
I, [2015-05-16T00:15:38.369270 #2803] INFO -- : master process ready
I, [2015-05-16T00:15:38.372035 #2811] INFO -- : worker=2 ready
I, [2015-05-16T00:15:38.372576 #2806] INFO -- : worker=0 ready
I, [2015-05-16T00:15:38.375378 #2814] INFO -- : worker=3 ready
时sudo service sh0 start
看起来很糟糕:
sudo tail -f /var/log/upstart/sh0.log
有什么建议吗?
答案 0 :(得分:-1)
答案:完全没有理由。
sudo reboot now
它有效。关于为什么未来开发者可能会赞赏的任何评论。