【发布时间】:2017-04-18 07:12:27
【问题描述】:
我正在尝试通过创建 linux vm 来使用 Azure 批处理服务。我有一些我正在使用 python 的计算。要安装一些 python 包,我已将安装命令放在脚本文件中并尝试在启动时运行它。
pool.StartTask = new StartTask
{
// Specify a command line for the StartTask that copies the task application files to th
CommandLine = "bash -c \"bash /mnt/batch/tasks/startup/wd/installpackages.sh\"",
ResourceFiles = resourceFiles,
WaitForSuccess = true,
MaxTaskRetryCount = 5
};
由于权限问题,此脚本执行失败。当我尝试使用“sudo”运行脚本时,会出现以下错误,
sudo: no tty present and no askpass program specified
脚本由用户“_azbatch”执行,使用 sudo 时会提示输入我不知道的密码。
如何克服这个问题?
【问题讨论】:
-
一开始我不能使用 sudo,而且我想分拆大约 50 个虚拟机,所以我不能 ssh 进入每台机器。
-
我检查了日志。我在脚本中加入了“whoami”并看到了输出。用户是“_azbatch”
标签: python linux azure azure-batch