[英]Startup script NOT running in instance
I have a instance where I have some Flask web app.我有一个实例,我有一些 Flask web 应用程序。 In order the app to start when the VM is booted I have included a startup script:
为了在 VM 启动时启动应用程序,我包含了一个启动脚本:
#!/bin/sh
cd documentai_webapp
cd docai_webapp_instance_gcp
sudo python3 server.py
However, this is not at all executed, anyone can help me?thanks!但是,这根本没有执行,任何人都可以帮助我吗?谢谢!
PD: When I execute this script manually within the VM it works perfectly fine PD:当我在虚拟机中手动执行这个脚本时,它工作得很好
I did not know that the startup script is executed with root , so the change directory was not finding the correct directory (I've added the HOME path of my user and it works)我不知道启动脚本是用root执行的,所以更改目录没有找到正确的目录(我已经添加了我的用户的 HOME 路径并且它有效)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.