简体   繁体   English

启动脚本不在实例中运行

[英]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.

相关问题 谷歌云启动脚本未运行 - Google Cloud Startup Script Not Running 谷歌云笔记本实例运行脚本不在启动 - google cloud notebook instance run script not in startup 在 GCP 中运行修改后的启动脚本时出现问题 - Problem running a modified startup-script in GCP 在谷歌云计算实例启动时启动 python 脚本 - Starting python script on Google Cloud Compute instance startup metadata_startup_script 未使用 Terraform 脚本在 VM 实例 GCP 内安装 sql 服务器代理 - metadata_startup_script is not installing sql server proxy inside the VM instance GCP using Terraform script 如何从 GCE 实例中的 Container-optimized OS 获取启动脚本日志? - How do I get startup-script logs from Container-optimized OS in a GCE instance? 使用 SSH 连接和启动脚本运行 bash 脚本时出现不同的行为 - Getting different behavior when running bash script using SSH connection and startup-script Azure 启动脚本未执行 - Azure startup script is not executed 运行我制作的脚本后无法访问 ec2 实例 - Lost access to ec2 instance after running this script I made aws ec2 启动时运行脚本程序 - Aws Ec2 run script program at startup
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM