Jenkins windows slave 服务不与桌面交互 [英] Jenkins windows slave service does not interact with desktop

查看:37
本文介绍了Jenkins windows slave 服务不与桌面交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照本指南在 Windows 8 上安装 jenkins slave 作为服务:

https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+as+a+Windows+service#InstallingJenkinsasaWindowsservice-InstallSlaveasaWindowsservice%28require.NET2.0framework%29

我需要运行与桌面交互的作业(运行打开浏览器的应用程序等).因此,在我将从站安装为服务(运行从主站下载的 jnlp)之后,我将服务登录"更改为允许与显示器交互".

出于某种原因,它只能为本地系统帐户"启用此功能,即使它建议以指定用户身份运行该服务,例如.詹金斯.

但是当我执行作业时没有任何反应,浏览器没有打开.如果我改为停止服务并通过 jnlp 文件启动从站,则作业运行良好 - 浏览器已打开.

在将 jenkins Windows slave 作为服务运行时,有人有幸与桌面交互吗?

解决方案

服务从 Vista 开始在会话 0 中运行,第一个用户现在在会话 1 中.因此您无法再进行交互.这称为会话 0 隔离.

微软对此进行了解释 此处此处.您必须使用使用 IPC 与服务通信的第二个程序. >

I have followed this guide to install a jenkins slave on windows 8 as a service:

https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+as+a+Windows+service#InstallingJenkinsasaWindowsservice-InstallSlaveasaWindowsservice%28require.NET2.0framework%29

I need to run a job that interact with the desktop (run an application that opens a browser etc.). So after I have installed the slave as a service (running jnlp downloaded from the master) I have changed the service "Log on" to "Allow to interact with display".

For some reason its only possible to enable this for the "Local System account" even though its recommended to run the service as a specified user, eg. jenkins.

But nothing happens when I execute the job, the browser is not opened. If I instead stop the service and just launch the slave through the jnlp file the job runs fine - the browser is opened.

Anybody had any luck interacting with the desktop when running a jenkins windows slave as a service?

解决方案

Services run since Vista in Session 0 and the first user is now in Session 1. So you can't interact any longer. This is called Session 0 Isolation.

Microsoft explains this here and here. You have to use 2nd Program which uses IPC to communicate to the Service.

这篇关于Jenkins windows slave 服务不与桌面交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆