windows 在 win8.1 和 win10 上安装 Jenkins Slave as Service

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36500231/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:33:10  来源:igfitidea点击:

Installing Jenkins Slave as Service on win8.1 and win10

windowsjenkinsjenkins-pluginsjenkins-slave

提问by zalimgandhera

I am trying to install Jenkins slave service after starting the slave via web start. I get the following error when it tries to install on windows 10 and windows 8.1.

我正在尝试通过 web start 启动从站后安装 Jenkins 从站服务。尝试在 Windows 10 和 Windows 8.1 上安装时出现以下错误。

[JenkinsWorkDirectory]$ c:\JenkinsWorkDirectory\jenkins-slave.exe install
WMI.WmiException:AccessDenied
at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] args)
at WMI.Win32ServicesProxy.Create(String, String, String, ServiceType, ErrorControl, StartMode, Boolean, String, String, String[])
at winsw.WrapperService.Run(String[]_args,ServiceDescriptor descriptor)
at winsw.WrapperService.Main(String[]args).

I can install the slave service without any issue on win 7. Any idea why is this happening or is it some limitation of Jenkins or am i missing some dependency?

我可以在 win 7 上安装从属服务而没有任何问题。知道为什么会发生这种情况,还是 Jenkins 的某些限制,或者我是否缺少某些依赖项?

My jenkins version is 1.655 and using chrome browser when installing. Jenkins master is running on windows 7. Thanks, Daniel

我的 jenkins 版本是 1.655,安装时使用 chrome 浏览器。詹金斯大师在 Windows 7 上运行。谢谢,丹尼尔

回答by Steve Brownell

I found another way to get the slave to install.

我找到了另一种让从站安装的方法。

  1. Open a command window with "Run as Administrator".
  2. Change directory to the place where you saved the slave-agent.jnlp file.
  3. at the prompt run "slave-agent.jnlp"
  4. Now with the running slave click the menu item to "Install as Service".
  1. 使用“以管理员身份运行”打开命令窗口。
  2. 将目录更改为保存 slave-agent.jnlp 文件的位置。
  3. 在提示符下运行“slave-agent.jnlp”
  4. 现在使用正在运行的从站,单击菜单项“安装为服务”。

The trick is to do it while running as an administrator. This installs the service running under localsystem.

诀窍是在以管理员身份运行时执行此操作。这将安装在本地系统下运行的服务。

Additionally, if you're like me and you need your jenkins routines to hit another machine, you'll need to change the service to run as a user with permission (network or otherwise) to do the task you want done.

此外,如果您像我一样需要 jenkins 例程来访问另一台机器,则需要更改服务以作为具有权限(网络或其他)的用户运行来执行您想要完成的任务。

回答by Anantha

  1. Open a command window with "Run as Administrator".
  2. Just in case, You may have trouble with the .jnlp in "Steve Brownell" instructions, then, run the first line of your error message, shown below. c:\JenkinsWorkDirectory\jenkins-slave.exe install
  1. 使用“以管理员身份运行”打开命令窗口。
  2. 以防万一,您可能会遇到“Steve Brownell”说明中的 .jnlp 问题,然后运行错误消息的第一行,如下所示。c:\JenkinsWorkDirectory\jenkins-slave.exe 安装

回答by Ras Dama

goto your downloaded jenkins-slave.exe Application file.

转到您下载的 jenkins-slave.exe 应用程序文件。

goto properties -> compatibility -.> check run as administrator.

转到属性-> 兼容性-.> 检查以管理员身份运行。

Now try installing it as service again. It will work.

现在尝试再次将其安装为服务。它会起作用。

回答by Rahul Modi

"C:\Program Files (x86)\Java\jre1.8.0_161\bin\javaws.exe" slave-agent.jnlp just run this from command prompt my issue got resolved from this as an administrator

“C:\