标签: forever

从 Google Cloud Platform App Engine 启动脚本运行永久脚本

我已经编辑了在 Google Cloud Platform App Engine 上运行的实例之一的启动脚本变量。我希望它调用一个永久脚本来确保我的节点应用程序正在运行。所以我补充道:

cd /opt/bitnami/apps/myapp
forever start --workingDir /opt/bitnami/apps/myapp/ --sourceDir /opt
/bitnami/apps/myapp/ app.js
Run Code Online (Sandbox Code Playgroud)

在 #!/bin/bash 行之后(也尝试过不使用 cd,因为根据我的命令,这并不是真正必要的)。但是,一旦虚拟机启动,运行永久列表不会将我的永久任务列为已启动。如果我将该永久命令复制并粘贴到 gcloud 终端并运行,该任务显示正常,并且我的应用程序启动没有问题。

我在 bash 脚本中是否没有正确调用它?

bash google-app-engine node.js forever mean-stack

2
推荐指数
1
解决办法
2213
查看次数

错误:永远检测到脚本退出代码:1

我正在使用永远重新启动 nodejs-app 以防它崩溃。在某些情况下,应用程序不会重新启动。Forever 只显示消息:

错误:永远检测到脚本退出代码:1

我不想解决应用程序本身的问题,我只需要一次又一次地重新启动。也许我缺少参数?

关于永远不在此处重新启动的其他问题并未解决我的具体情况。

node.js forever

2
推荐指数
1
解决办法
5190
查看次数

通知不起作用.. waitng永远线程Java

您好我是编程的新手,我正在尝试做一个简单的生产者 - 消费者问题..但不幸的是我的线程永远等待..notify不工作..任何想法?:/

public synchronized void order() throws Exception{

    System.out.println("User "+name+" requests:\n"+"cherries=" + cherries);

    while(checkValues()==true){
        System.out.println(name+"  waiting");
        wait(); 
    } 
    notify();
    Update();
    store.toString();

    System.out.println(name+" gets resources ");
    Thread.sleep(5000);
 }
Run Code Online (Sandbox Code Playgroud)

java multithreading notify wait forever

1
推荐指数
1
解决办法
68
查看次数

而循环循环永远Python

所以,我正在研究一个掷骰子程序模拟器,从浏览网页,以及来自这个论坛上的用户的一些帮助.我能够在大多数情况下完成它.至少,我认为我有正确的游戏逻辑.

它是我上次使用它时运行但是我必须在没有意识到它的情况下改变了一些东西,因为现在while循环正在运行.在该计划中,骰子在没有用户干预的情况下永远滚动.

有人可以看一看,看看代码是否有问题?我已经在这个工作了几个小时,没有在哪里.

我再也不会赌博了!:/

from Dice import PairOfDice
print("Now Let's play with two dice!")
#
def MainDouble():
    bdice = PairOfDice()
    doubleDiceRoll = ''
    global myPoint #declare global variable
    input("Press Enter to Roll the Dice once")

    while doubleDiceRoll == '': #Roll the dice (both die objects)
        bdice.toss()
        print ('The first die reads.. ' + str(bdice.getValue1()) + '\n')
        print ('The second die reads.. ' + str(bdice.getValue2()) + '\n')

        Val = bdice.getTotal()

##Beginning of conditional blocks##
    if Val == 7 or Val == …
Run Code Online (Sandbox Code Playgroud)

python loops while-loop forever

0
推荐指数
1
解决办法
547
查看次数

具有root权限的forever模块是否还使用root权限运行其他进程?

有一段时间我在设置Node.js Web服务器时提到了这个流行的答案.

但是,这个看似重要的评论我希望提出一个问题:

如果我将我的Node.js启动脚本添加到/etc/rc.local,它不会在系统启动时以root身份执行吗?这将破坏端口80重定向的目的.

如果我forever以root身份运行包,那么永远也会以root身份运行其进程吗?我在npm文档中找不到关于这一点的任何信息.如果永远确实以root身份运行进程,那么它确实会破坏目的并且应该相应地更新答案.

node.js forever

-3
推荐指数
1
解决办法
711
查看次数