[英]Python script running as screen process gets “Killed” on Ubuntu / AWS EC2
I want to have a python script running on my Ubuntu instance constantly.我想在我的 Ubuntu 实例上不断运行 python 脚本。 It's an AWS EC2 a1.medium instance and the script is taking pretty much 100% of the CPU constantly.
这是一个 AWS EC2 a1.medium 实例,脚本不断占用几乎 100% 的 CPU。
I start the script with screen <run script>
, however it gets killed randomly and I have no idea why.我用
screen <run script>
启动脚本,但是它被随机杀死,我不知道为什么。 One time I had it running in the foreground and I saw "Killed" as the last output of the process.有一次我让它在前台运行,我看到“Killed”是进程的最后一个 output。
I tried running it as root with sudo screen <run script>
but I get [screen is terminating]
.我尝试使用
sudo screen <run script>
以 root 身份运行它,但我得到[screen is terminating]
。 Not sure if root would even help though.不确定root是否会有所帮助。
Is there anything I can do to troubleshoot this?我能做些什么来解决这个问题吗? I tried with
-L -Logfile <filename>
with proper permissions for the file, but it stays empty, so I really have no idea how to tell what went wrong.我尝试使用
-L -Logfile <filename>
对文件具有适当的权限,但它保持为空,所以我真的不知道如何判断出了什么问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.