Ruby Upstart每次都在检查并尝试启动进程,占用了99%的CPU
我有一个ruby进程,必须在系统启动时启动。因此,我在/etc/init.d目录中为它创建了init.d文件。文件是/etc/init.d/remote\u syslog 它通过运行以下命令启动进程 /home/ubuntu/.rvm/gems/ruby-2.1.0/bin/remote\u syslog-c/etc/log\u files.yml-pid file/home/ubuntu/remote\u syslog.pid 我编写了upstart脚本,以确保流程重新启动Ruby Upstart每次都在检查并尝试启动进程,占用了99%的CPU,ruby,linux,ubuntu,upstart,init.d,Ruby,Linux,Ubuntu,Upstart,Init.d,我有一个ruby进程,必须在系统启动时启动。因此,我在/etc/init.d目录中为它创建了init.d文件。文件是/etc/init.d/remote\u syslog 它通过运行以下命令启动进程 /home/ubuntu/.rvm/gems/ruby-2.1.0/bin/remote\u syslog-c/etc/log\u files.yml-pid file/home/ubuntu/remote\u syslog.pid 我编写了upstart脚本,以确保流程重新启动 descripti
description "Monitor files and send to remote syslog"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec sudo /etc/init.d/remote_syslog start >> /tmp/upstart.log 2>&1
此文件另存为“/etc/init/remote\u syslog\u upstart.conf”
通过检查/tmp/upstart.log,我了解到,每隔一秒钟,它都会通过调用init.d脚本来尝试运行ruby命令,因为它已经在运行了,ruby命令返回的消息是:已经在/home/ubuntu/remote_syslog.pid运行了
现在的问题是,由于它每次都执行ruby命令,ruby占用了99%的CPU,我可以在系统上做任何其他事情
这是我第一次和暴发户合作。我在这里做错什么了吗
description "Monitor files and send to remote syslog"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec sudo /etc/init.d/remote_syslog start >> /tmp/upstart.log 2>&1