亚马逊AWS的用户数据不执行在Ubuntu 14.04 AMI亚马逊、数据、用户、AWS

由网友(一组六个字的潮流好听与大家分享啦,里面有适合男生用的,也有适)分享简介:下面的用户数据未在Ubuntu的14.04 AMI具有云初始化包运行:The following user-data is not running on a Ubuntu 14.04 AMI that has cloud-init package:#!/bin/bashscreen -t "test" pwd在该...

下面的用户数据未在Ubuntu的14.04 AMI具有云初始化包运行:

The following user-data is not running on a Ubuntu 14.04 AMI that has cloud-init package:

#!/bin/bash
screen -t "test" pwd

在该实例初始化,屏幕-r 打印没有屏幕被恢复。是用户 - 数据创造了不正确?

After the instance has initialized, screen -r prints There is no screen to be resumed. Is the user-data created incorrectly?

推荐答案

我相信屏幕上有附加到一个终端来运行。通过云初始化运行的脚本是没有连接到终端。

I believe screen has to be attached to a terminal to run. Scripts run by cloud-init aren't attached to a terminal.

如果你想确保用户数据的脚本正在运行,把像回声运行>的/ tmp / checkit 作为第一行(以下#!/斌/ bash的),所以你可以看到,如果它创建的文件。

If you want to be sure your user-data script is being run, put something like echo Running > /tmp/checkit as the first line (following #!/bin/bash) so you can see if it creates the file.

阅读全文

相关推荐

最新文章