本文介绍了AZURE启动任务挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我已经添加了的的安装文件,以及脚本静默安装它。

I have an Azure project with an MVC4 role where I have added the Visual C++ 2012 Runtime Library setup file, and a script to silently install it.

这个脚本和图书馆被安装,唯一的问题是,任务永远不会完成并在安装过程永远不会退出,然后从起跑器的作用:

The script works and the library gets installed, the only problem is that the task never finishes and the installation process never exits, which then blocks the role from starting:

我使用远程桌面连接到服务器,并通过查看任务管理器,我可以看到这个过程的 vcredist_x64.exe :(其中2实际的,但我认为这是正常的)

I connected to the server using Remote Desktop, and by looking at the task manager I can see the process vcredist_x64.exe: (2 of them actually, but I think that's normal)

当我右键单击并杀死进程,部署成功完成和角色开始。

When I right-click and kill the process, the deployment finishes successfully and the role is started.

这是当我启动任务设置为简单中的 ServiceDefinition.csdef中的一个问题,因为这使服务器等待,直到任务完成后启动角色。因此,我所做的就是将任务设置为背景,以便启动脚本不会阻止起了作用,但即使如此,该进程仍然在后台运行,并已被杀害手动。

This is a problem when my start-up task is set to simple in ServiceDefinition.csdef, since that makes the server wait until the task is finished to start the role. So what I did was to set the task to background so the start-up script doesn't block the role from starting anymore, but even then the process is still running in the background and has to be killed manually.

该脚本应该工作,并具有之前,2010年VC ++库(如果没有退出,虽然,但应该在那里,以避免阻塞的作用,如果脚本返回一个错误,code):

This script should work, and has before with the 2010 VC++ library (Without the EXIT though, but that should be there as to avoid blocking the role if the script returns an error code):

vcredist_x64.exe /quiet /norestart
EXIT /B 0

没有工作,所以我想我会杀的过程中安装后手动:

Didn't work, so I thought I'd kill the process manually after the installation:

vcredist_x64.exe /quiet /norestart
TASKKILL /F /T /IM vcredist_x64.exe
EXIT /B 0

没有工作,过程中还活着。该脚本实际工作,如果我在服务器上手动运行它自己,或在本地,但在Azure的尝试部署期间做死了。

Didn't work, process was still alive. The script actually works if I run it manually myself on the server, or locally, but when Azure tries to do it during deployment it hangs.

我的启动任务的定义如下ServiceDefinition.csdef中:

My Start-up task is defined like this in ServiceDefinition.csdef:

<Startup>
  <Task commandLine="InstallVcRedist.cmd" executionContext="elevated" taskType="background" />
</Startup>

C中的日志:\资源\ TEMP \ {RoleId.RoleName} \ RoleTemp 说一切正常。

我能避免从被阻止通过设置启动任务到背景,而不是简单的作用,但并没有真正解决问题。谢谢你。

I can avoid the role from being blocked by setting the startup-task to background instead of simple, but that doesn't really solve the problem. Thanks.

推荐答案

我想通了,为什么这是怎么回事,幸亏的由史蒂夫·马克思。

I figured out why this was happening, thanks to this blog post by Steve Marx.

此问题只发生在Windows Server 2008中的 SP2 ,所以只好将主机更改为Windows Server 2008的 R2
这可以通过更改做 osFamily =1 osFamily =2所有的 ServiceConfiguration 的文件,也可以从Azure的门户网站通过单击服务,然后修改的配置OS 的顶部。

This problem only occurs in Windows Server 2008 SP2, so I had to change the host to Windows Server 2008 R2.
This can be done by changing osFamily="1" to osFamily="2" in all of the ServiceConfiguration files, or it can be changed from the Azure portal by clicking on the service then Configure OS at the top.

这篇关于AZURE启动任务挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 15:54