You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Fernando O." <fo...@gmail.com> on 2022/08/19 12:46:19 UTC

[daemon] Procrun and -javaagent

Hi all,
    Disclaimer:  I'm pretty new to windows, I worked most of my life on
linux

    I'm trying to add a java agent to a windows service, that was installed
with procrun. In the doc it seems like there's no option for adding an
agent.
I tried adding it to options (the doc says that accepts -D and -X) but just
in case I tried with -javaagent as in command line but it's failing. I
can't find a way to get proper logs on what's going on either. Does anyone
know if this is doable?
Or how to get trace/debug lvl logs from the jvm?

I'ḿ running it in jvm mode.


[image: image.png]

Re: [daemon] Procrun and -javaagent

Posted by Gary Gregory <ga...@gmail.com>.
I don't think it can be dead since we are maintaining it for Tomcat to use.

Gary

On Wed, Aug 24, 2022, 23:36 Mladen Turk <mt...@apache.org> wrote:

>
>
> On 20/08/2022 20:05, Martin Gainty wrote:
> > Apparently you can but only as a jenkinsWindowService.exe
> > How to install Windows agents as a service? (cloudbees.com)<
> https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-masters/how-to-install-windows-agents-as-a-service
> >
> > How to install Windows agents as a service? - CloudBees<
> https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-masters/how-to-install-windows-agents-as-a-service
> >
> > You can use ssh to connect the agent by following Configuring Windows
> agents Note: This solution does not actually use a Windows service, as the
> agent launch is handeled by your controller automatically.
> > docs.cloudbees.com
> > Follow these instructions faithfully to get Windows Service
> WinSW-64x.exe (now renamed as jenkinsWindowService.exe) as a service to run
> your agents main jar working for you
> >
>
> You can also use
> https://github.com/mturk/svcbatch
>
> since procrun is old and dead technology
> and have no intention to maintain that further
>
> Regards
> --
> ^TM
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [daemon] Procrun and -javaagent

Posted by Mladen Turk <mt...@apache.org>.

On 20/08/2022 20:05, Martin Gainty wrote:
> Apparently you can but only as a jenkinsWindowService.exe
> How to install Windows agents as a service? (cloudbees.com)<https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-masters/how-to-install-windows-agents-as-a-service>
> How to install Windows agents as a service? - CloudBees<https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-masters/how-to-install-windows-agents-as-a-service>
> You can use ssh to connect the agent by following Configuring Windows agents Note: This solution does not actually use a Windows service, as the agent launch is handeled by your controller automatically.
> docs.cloudbees.com
> Follow these instructions faithfully to get Windows Service WinSW-64x.exe (now renamed as jenkinsWindowService.exe) as a service to run your agents main jar working for you
> 

You can also use
https://github.com/mturk/svcbatch

since procrun is old and dead technology
and have no intention to maintain that further

Regards
-- 
^TM

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [daemon] Procrun and -javaagent

Posted by Martin Gainty <mg...@hotmail.com>.
Apparently you can but only as a jenkinsWindowService.exe
How to install Windows agents as a service? (cloudbees.com)<https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-masters/how-to-install-windows-agents-as-a-service>
How to install Windows agents as a service? - CloudBees<https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-masters/how-to-install-windows-agents-as-a-service>
You can use ssh to connect the agent by following Configuring Windows agents Note: This solution does not actually use a Windows service, as the agent launch is handeled by your controller automatically.
docs.cloudbees.com
Follow these instructions faithfully to get Windows Service WinSW-64x.exe (now renamed as jenkinsWindowService.exe) as a service to run your agents main jar working for you

Un saludo
________________________________
From: Fernando O. <fo...@gmail.com>
Sent: Friday, August 19, 2022 8:46 AM
To: Commons Users List <us...@commons.apache.org>
Subject: [daemon] Procrun and -javaagent

Hi all,
    Disclaimer:  I'm pretty new to windows, I worked most of my life on linux

    I'm trying to add a java agent to a windows service, that was installed with procrun. In the doc it seems like there's no option for adding an agent.
I tried adding it to options (the doc says that accepts -D and -X) but just in case I tried with -javaagent as in command line but it's failing. I can't find a way to get proper logs on what's going on either. Does anyone know if this is doable?
Or how to get trace/debug lvl logs from the jvm?

I'ḿ running it in jvm mode.


[image.png]

Re: [daemon] Procrun and -javaagent

Posted by "Fernando O." <fo...@gmail.com>.
RTFM to me *  :D

On Fri, Aug 19, 2022 at 12:47 PM Fernando O. <fo...@gmail.com> wrote:

> nevermind, just RTF .... I used spaces to separate JavaOptions instead of
> ; or #
>
> Thanks guys
>
> On Fri, Aug 19, 2022 at 12:42 PM Fernando O. <fo...@gmail.com> wrote:
>
>> Same issue with the newest version:
>> [2022-08-19 15:39:52] [debug] ( prunsrv.c:1994) [  980] Apache Commons
>> Daemon procrun log initialized.
>> [2022-08-19 15:39:52] [info]  ( prunsrv.c:2002) [  980] Apache Commons
>> Daemon procrun (1.3.1.0 64-bit) started.
>> [2022-08-19 15:39:52] [info]  ( prunsrv.c:1906) [  980] Running Service
>> 'CodeProfilerFer'...
>> [2022-08-19 15:39:52] [debug] ( prunsrv.c:1677) [13844] Inside
>> serviceMain()...
>> [2022-08-19 15:39:52] [debug] ( prunsrv.c:1123) [13844]
>> reportServiceStatusE: dwCurrentState = 2 (SERVICE_START_PENDING),
>> dwWin32ExitCode = 0, dwWaitHint = 3000 milliseconds,
>> dwServiceSpecificExitCode = 0.
>> [2022-08-19 15:39:52] [info]  ( prunsrv.c:1422) [13844] Starting
>> service...
>> [2022-08-19 15:39:52] [debug] ( prunsrv.c:497 ) [13844] Checking Java
>> options for environment variable requirements
>> [2022-08-19 15:39:52] [debug] ( prunsrv.c:501 ) [13844] Checking
>> environment variable requirements for '-javaagent:newrelic.jar
>> -Djavax.xml.xpath.XPathFactory:
>> http://java.sun.com/jaxp/xpath/dom=com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
>> '
>> [2022-08-19 15:39:52] [debug] ( javajni.c:216 ) [13844] Explicit
>> RuntimeLib specified 'C:\Program
>> Files\java\jdk-17.0.2.8-hotspot\\bin\../bin/server/jvm.dll'
>> [2022-08-19 15:39:52] [debug] ( javajni.c:280 ) [13844] Adding Java bin
>> path to the PATH to fix loading of awt.dll: 'C:\Program
>> Files\java\jdk-17.0.2.8-hotspot\\bin\../bin'
>> [2022-08-19 15:39:52] [debug] ( javajni.c:286 ) [13844] Loading JVM DLL
>> 'C:\Program Files\java\jdk-17.0.2.8-hotspot\\bin\../bin/server/jvm.dll'
>> [2022-08-19 15:39:52] [debug] ( javajni.c:414 ) [13844] Loaded JVM DLL
>> 'C:\Program Files\java\jdk-17.0.2.8-hotspot\\bin\../bin/server/jvm.dll',
>> home '(null)'.
>> [2022-08-19 15:39:52] [debug] ( javajni.c:419 ) [13844]
>> JNI_GetCreatedJavaVMs...
>> [2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[0]
>> -javaagent:newrelic.jar -Djavax.xml.xpath.XPathFactory:
>> http://java.sun.com/jaxp/xpath/dom=com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
>> [2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[1]
>> -Djava.class.path=C:\test.jar
>> [2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[2] exit
>> [2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[3]
>> abort
>>
>>
>> On Fri, Aug 19, 2022 at 12:28 PM Fernando O. <fo...@gmail.com> wrote:
>>
>>> Hi Thanks for the fast answer!
>>> I'm using command line : Commons Daemon Service Runner version
>>> 1.0.3.0/Win64 (Jul 30 2010)
>>>
>>> Pretty old.... I'll try to update
>>>
>>> On Fri, Aug 19, 2022 at 10:58 AM Mark Thomas <ma...@apache.org> wrote:
>>>
>>>> Hi,
>>>>
>>>> What version of Commons Daemon?
>>>>
>>>> Are you configuring the service via the UI or the command line?
>>>>
>>>> Mark
>>>>
>>>> On 19/08/2022 13:46, Fernando O. wrote:
>>>> > Hi all,
>>>> >      Disclaimer:  I'm pretty new to windows, I worked most of my life
>>>> on
>>>> > linux
>>>> >
>>>> >      I'm trying to add a java agent to a windows service, that was
>>>> > installed with procrun. In the doc it seems like there's no option
>>>> for
>>>> > adding an agent.
>>>> > I tried adding it to options (the doc says that accepts -D and -X)
>>>> but
>>>> > just in case I tried with -javaagent as in command line but it's
>>>> > failing. I can't find a way to get proper logs on what's going on
>>>> > either. Does anyone know if this is doable?
>>>> > Or how to get trace/debug lvl logs from the jvm?
>>>> >
>>>> > I'ḿ running it in jvm mode.
>>>> >
>>>> >
>>>> > image.png
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>>

Re: [daemon] Procrun and -javaagent

Posted by "Fernando O." <fo...@gmail.com>.
nevermind, just RTF .... I used spaces to separate JavaOptions instead of ;
or #

Thanks guys

On Fri, Aug 19, 2022 at 12:42 PM Fernando O. <fo...@gmail.com> wrote:

> Same issue with the newest version:
> [2022-08-19 15:39:52] [debug] ( prunsrv.c:1994) [  980] Apache Commons
> Daemon procrun log initialized.
> [2022-08-19 15:39:52] [info]  ( prunsrv.c:2002) [  980] Apache Commons
> Daemon procrun (1.3.1.0 64-bit) started.
> [2022-08-19 15:39:52] [info]  ( prunsrv.c:1906) [  980] Running Service
> 'CodeProfilerFer'...
> [2022-08-19 15:39:52] [debug] ( prunsrv.c:1677) [13844] Inside
> serviceMain()...
> [2022-08-19 15:39:52] [debug] ( prunsrv.c:1123) [13844]
> reportServiceStatusE: dwCurrentState = 2 (SERVICE_START_PENDING),
> dwWin32ExitCode = 0, dwWaitHint = 3000 milliseconds,
> dwServiceSpecificExitCode = 0.
> [2022-08-19 15:39:52] [info]  ( prunsrv.c:1422) [13844] Starting service...
> [2022-08-19 15:39:52] [debug] ( prunsrv.c:497 ) [13844] Checking Java
> options for environment variable requirements
> [2022-08-19 15:39:52] [debug] ( prunsrv.c:501 ) [13844] Checking
> environment variable requirements for '-javaagent:newrelic.jar
> -Djavax.xml.xpath.XPathFactory:
> http://java.sun.com/jaxp/xpath/dom=com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
> '
> [2022-08-19 15:39:52] [debug] ( javajni.c:216 ) [13844] Explicit
> RuntimeLib specified 'C:\Program
> Files\java\jdk-17.0.2.8-hotspot\\bin\../bin/server/jvm.dll'
> [2022-08-19 15:39:52] [debug] ( javajni.c:280 ) [13844] Adding Java bin
> path to the PATH to fix loading of awt.dll: 'C:\Program
> Files\java\jdk-17.0.2.8-hotspot\\bin\../bin'
> [2022-08-19 15:39:52] [debug] ( javajni.c:286 ) [13844] Loading JVM DLL
> 'C:\Program Files\java\jdk-17.0.2.8-hotspot\\bin\../bin/server/jvm.dll'
> [2022-08-19 15:39:52] [debug] ( javajni.c:414 ) [13844] Loaded JVM DLL
> 'C:\Program Files\java\jdk-17.0.2.8-hotspot\\bin\../bin/server/jvm.dll',
> home '(null)'.
> [2022-08-19 15:39:52] [debug] ( javajni.c:419 ) [13844]
> JNI_GetCreatedJavaVMs...
> [2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[0]
> -javaagent:newrelic.jar -Djavax.xml.xpath.XPathFactory:
> http://java.sun.com/jaxp/xpath/dom=com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
> [2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[1]
> -Djava.class.path=C:\test.jar
> [2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[2] exit
> [2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[3] abort
>
>
> On Fri, Aug 19, 2022 at 12:28 PM Fernando O. <fo...@gmail.com> wrote:
>
>> Hi Thanks for the fast answer!
>> I'm using command line : Commons Daemon Service Runner version
>> 1.0.3.0/Win64 (Jul 30 2010)
>>
>> Pretty old.... I'll try to update
>>
>> On Fri, Aug 19, 2022 at 10:58 AM Mark Thomas <ma...@apache.org> wrote:
>>
>>> Hi,
>>>
>>> What version of Commons Daemon?
>>>
>>> Are you configuring the service via the UI or the command line?
>>>
>>> Mark
>>>
>>> On 19/08/2022 13:46, Fernando O. wrote:
>>> > Hi all,
>>> >      Disclaimer:  I'm pretty new to windows, I worked most of my life
>>> on
>>> > linux
>>> >
>>> >      I'm trying to add a java agent to a windows service, that was
>>> > installed with procrun. In the doc it seems like there's no option for
>>> > adding an agent.
>>> > I tried adding it to options (the doc says that accepts -D and -X) but
>>> > just in case I tried with -javaagent as in command line but it's
>>> > failing. I can't find a way to get proper logs on what's going on
>>> > either. Does anyone know if this is doable?
>>> > Or how to get trace/debug lvl logs from the jvm?
>>> >
>>> > I'ḿ running it in jvm mode.
>>> >
>>> >
>>> > image.png
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>

Re: [daemon] Procrun and -javaagent

Posted by "Fernando O." <fo...@gmail.com>.
Same issue with the newest version:
[2022-08-19 15:39:52] [debug] ( prunsrv.c:1994) [  980] Apache Commons
Daemon procrun log initialized.
[2022-08-19 15:39:52] [info]  ( prunsrv.c:2002) [  980] Apache Commons
Daemon procrun (1.3.1.0 64-bit) started.
[2022-08-19 15:39:52] [info]  ( prunsrv.c:1906) [  980] Running Service
'CodeProfilerFer'...
[2022-08-19 15:39:52] [debug] ( prunsrv.c:1677) [13844] Inside
serviceMain()...
[2022-08-19 15:39:52] [debug] ( prunsrv.c:1123) [13844]
reportServiceStatusE: dwCurrentState = 2 (SERVICE_START_PENDING),
dwWin32ExitCode = 0, dwWaitHint = 3000 milliseconds,
dwServiceSpecificExitCode = 0.
[2022-08-19 15:39:52] [info]  ( prunsrv.c:1422) [13844] Starting service...
[2022-08-19 15:39:52] [debug] ( prunsrv.c:497 ) [13844] Checking Java
options for environment variable requirements
[2022-08-19 15:39:52] [debug] ( prunsrv.c:501 ) [13844] Checking
environment variable requirements for '-javaagent:newrelic.jar
-Djavax.xml.xpath.XPathFactory:
http://java.sun.com/jaxp/xpath/dom=com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
'
[2022-08-19 15:39:52] [debug] ( javajni.c:216 ) [13844] Explicit RuntimeLib
specified 'C:\Program
Files\java\jdk-17.0.2.8-hotspot\\bin\../bin/server/jvm.dll'
[2022-08-19 15:39:52] [debug] ( javajni.c:280 ) [13844] Adding Java bin
path to the PATH to fix loading of awt.dll: 'C:\Program
Files\java\jdk-17.0.2.8-hotspot\\bin\../bin'
[2022-08-19 15:39:52] [debug] ( javajni.c:286 ) [13844] Loading JVM DLL
'C:\Program Files\java\jdk-17.0.2.8-hotspot\\bin\../bin/server/jvm.dll'
[2022-08-19 15:39:52] [debug] ( javajni.c:414 ) [13844] Loaded JVM DLL
'C:\Program Files\java\jdk-17.0.2.8-hotspot\\bin\../bin/server/jvm.dll',
home '(null)'.
[2022-08-19 15:39:52] [debug] ( javajni.c:419 ) [13844]
JNI_GetCreatedJavaVMs...
[2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[0]
-javaagent:newrelic.jar -Djavax.xml.xpath.XPathFactory:
http://java.sun.com/jaxp/xpath/dom=com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
[2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[1]
-Djava.class.path=C:\test.jar
[2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[2] exit
[2022-08-19 15:39:52] [debug] ( javajni.c:817 ) [10548] JVM Option[3] abort


On Fri, Aug 19, 2022 at 12:28 PM Fernando O. <fo...@gmail.com> wrote:

> Hi Thanks for the fast answer!
> I'm using command line : Commons Daemon Service Runner version
> 1.0.3.0/Win64 (Jul 30 2010)
>
> Pretty old.... I'll try to update
>
> On Fri, Aug 19, 2022 at 10:58 AM Mark Thomas <ma...@apache.org> wrote:
>
>> Hi,
>>
>> What version of Commons Daemon?
>>
>> Are you configuring the service via the UI or the command line?
>>
>> Mark
>>
>> On 19/08/2022 13:46, Fernando O. wrote:
>> > Hi all,
>> >      Disclaimer:  I'm pretty new to windows, I worked most of my life
>> on
>> > linux
>> >
>> >      I'm trying to add a java agent to a windows service, that was
>> > installed with procrun. In the doc it seems like there's no option for
>> > adding an agent.
>> > I tried adding it to options (the doc says that accepts -D and -X) but
>> > just in case I tried with -javaagent as in command line but it's
>> > failing. I can't find a way to get proper logs on what's going on
>> > either. Does anyone know if this is doable?
>> > Or how to get trace/debug lvl logs from the jvm?
>> >
>> > I'ḿ running it in jvm mode.
>> >
>> >
>> > image.png
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>

Re: [daemon] Procrun and -javaagent

Posted by "Fernando O." <fo...@gmail.com>.
Hi Thanks for the fast answer!
I'm using command line : Commons Daemon Service Runner version 1.0.3.0/Win64
(Jul 30 2010)

Pretty old.... I'll try to update

On Fri, Aug 19, 2022 at 10:58 AM Mark Thomas <ma...@apache.org> wrote:

> Hi,
>
> What version of Commons Daemon?
>
> Are you configuring the service via the UI or the command line?
>
> Mark
>
> On 19/08/2022 13:46, Fernando O. wrote:
> > Hi all,
> >      Disclaimer:  I'm pretty new to windows, I worked most of my life on
> > linux
> >
> >      I'm trying to add a java agent to a windows service, that was
> > installed with procrun. In the doc it seems like there's no option for
> > adding an agent.
> > I tried adding it to options (the doc says that accepts -D and -X) but
> > just in case I tried with -javaagent as in command line but it's
> > failing. I can't find a way to get proper logs on what's going on
> > either. Does anyone know if this is doable?
> > Or how to get trace/debug lvl logs from the jvm?
> >
> > I'ḿ running it in jvm mode.
> >
> >
> > image.png
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [daemon] Procrun and -javaagent

Posted by Mark Thomas <ma...@apache.org>.
Hi,

What version of Commons Daemon?

Are you configuring the service via the UI or the command line?

Mark

On 19/08/2022 13:46, Fernando O. wrote:
> Hi all,
>      Disclaimer:  I'm pretty new to windows, I worked most of my life on 
> linux
> 
>      I'm trying to add a java agent to a windows service, that was 
> installed with procrun. In the doc it seems like there's no option for 
> adding an agent.
> I tried adding it to options (the doc says that accepts -D and -X) but 
> just in case I tried with -javaagent as in command line but it's 
> failing. I can't find a way to get proper logs on what's going on 
> either. Does anyone know if this is doable?
> Or how to get trace/debug lvl logs from the jvm?
> 
> I'ḿ running it in jvm mode.
> 
> 
> image.png

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [daemon] Procrun and -javaagent

Posted by Mantas Gridinas <mg...@gmail.com>.
For logs you should use stdout/stderr options and push them to a file
(assuming your logging library does not do that already). I'd suggest
running in cmd mode because you get to write full commandline as you would
want/need.

On Fri, Aug 19, 2022, 15:46 Fernando O. <fo...@gmail.com> wrote:

> Hi all,
>     Disclaimer:  I'm pretty new to windows, I worked most of my life on
> linux
>
>     I'm trying to add a java agent to a windows service, that was
> installed with procrun. In the doc it seems like there's no option for
> adding an agent.
> I tried adding it to options (the doc says that accepts -D and -X) but
> just in case I tried with -javaagent as in command line but it's failing. I
> can't find a way to get proper logs on what's going on either. Does anyone
> know if this is doable?
> Or how to get trace/debug lvl logs from the jvm?
>
> I'ḿ running it in jvm mode.
>
>
> [image: image.png]
>