--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/3193b476-8414-4c83-a3f3-a45cd6cbe1b5%40googlegroups.com.
C:\WINDOWS\system32>sc query "jenkins"
SERVICE_NAME: jenkins
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
C:\WINDOWS\system32>sc query "fred"
[SC] EnumQueryServicesStatus:OpenService FAILED 1060:
The specified service does not exist as an installed service.
C:\WINDOWS\system32>
On Tue, Dec 3, 2019 at 5:56 AM Adakar <jaku...@gmail.com> wrote:
Hi There :)--
I'm working on a Jenkins plugin. I'm looking for a way to check if the Jenkins agent is running as a Windows service. So far my idea is to check if the WINSW_SERVICE_ID is set. Is there any other way? Any suggestions are highly appreciated :)
BR, Adakar
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkin...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/6599e4e8-fded-4ab2-8e72-0651f718d9e9%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAO1vCWGAJUwJcyJvHihM3_DJPNmkNusYNG3YiqFyTQM%2B0jwp0A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/6599e4e8-fded-4ab2-8e72-0651f718d9e9%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAO1vCWGAJUwJcyJvHihM3_DJPNmkNusYNG3YiqFyTQM%2B0jwp0A%40mail.gmail.com.
My intention is to customize a plugin behavior based on the fact if the agent is running as a service. If it does, it should stop the build. If not, the build should be continued. I simply want my plugin to stop builds which are executing on agents that are running as a Windows Service.
https://www.oracle.com/technical-resources/articles/javase/headless.html
Thanks
-Mark