RE: Re: [daemon] High CPU load after update from 1.3.2 to 1.3.3

2024-07-09 Thread Christoffer Bruun

Hello,

I experience the same symptoms as Andreas (both on Procrun(AMD64)  1.3.4 
and 1.4.0). I am also running a SpringBoot application.


1: If I install the windows service with --StopTimeout=15,  then the 
process will use around 7-9% of CPU in Task Manager on my Lenovo P15 laptop.


2: If I install without --StopTimeout=15 then the process will use 
around 0-1% of CPU


In both cases no one is using the application.


br

Christoffer


On 2023/05/16 08:29:01 Andreas Kuhtz wrote:
> Hello,
>
> I know that the statement "high CPU load" ist pretty vague, but the CPU
> load in Windows task manager was the only visible thing I saw. No 
different

> logs even with LogLevel=DEBUG.
>
> But I found out that removing the StopTimeout parameter (in my case
> --StopTimeout=15) solves the issue. So I think it might be related to 
this

> change:
> 
https://github.com/apache/commons-daemon/commit/243a8521f780b98247820ae187e395597f6c9b51#diff-b4e825062840bfdafb7eeed624d22a66257983305ca7e21470b679bff4ef1ffeR1840-R1850

>
>
>
> Am Mo., 15. Mai 2023 um 21:08 Uhr schrieb
> :
>
> > Andreas,
> >
> > Use the java flight recorder to take a recording of a minute or 
two. Open
> > it in Java Mission Control and look at the method samples. That 
will give
> > you a good idea where the CPU usage is coming from. If that doesn't 
seem

> > helpful, maybe enable -XX+DebugNonSafepoints and try again.
> >
> >
> > > -Original Message-
> > > From: Andreas Kuhtz 
> > > Sent: Monday, May 15, 2023 11:25 AM
> > > To: user@commons.apache.org
> > > Subject: [daemon] High CPU load after update from 1.3.2 to 1.3.3
> > >
> > > Hi there,
> > >
> > > I see a high CPU load after updating commons-daemon from 1.3.2 to 
1.3.3

> > > (and 1.3.4) on my system.
> > > The application is a simple SpringBoot application that is 
started with

> > service-
> > > user LocalSystem (no difference if started with default value).
> > >
> > > How can I find the cause for this?
> > >
> > > Many thanks,
> > > Andreas
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > For additional commands, e-mail: user-h...@commons.apache.org
> >
>

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



Re: [daemon] High CPU load after update from 1.3.2 to 1.3.3

2023-05-16 Thread Andreas Kuhtz
Hello,

I know that the statement "high CPU load" ist pretty vague, but the CPU
load in Windows task manager was the only visible thing I saw. No different
logs even with LogLevel=DEBUG.

But I found out that removing the StopTimeout parameter (in my case
--StopTimeout=15) solves the issue. So I think it might be related to this
change:
https://github.com/apache/commons-daemon/commit/243a8521f780b98247820ae187e395597f6c9b51#diff-b4e825062840bfdafb7eeed624d22a66257983305ca7e21470b679bff4ef1ffeR1840-R1850



Am Mo., 15. Mai 2023 um 21:08 Uhr schrieb
:

> Andreas,
>
> Use the java flight recorder to take a recording of a minute or two.  Open
> it in Java Mission Control and look at the method samples.  That will give
> you a good idea where the CPU usage is coming from.  If that doesn't seem
> helpful, maybe enable -XX+DebugNonSafepoints and try again.
>
>
> > -Original Message-
> > From: Andreas Kuhtz 
> > Sent: Monday, May 15, 2023 11:25 AM
> > To: user@commons.apache.org
> > Subject: [daemon] High CPU load after update from 1.3.2 to 1.3.3
> >
> > Hi there,
> >
> > I see a high CPU load after updating commons-daemon from 1.3.2 to 1.3.3
> > (and 1.3.4) on my system.
> > The application is a simple SpringBoot application that is started with
> service-
> > user LocalSystem (no difference if started with default value).
> >
> > How can I find the cause for this?
> >
> > Many thanks,
> > Andreas
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>


RE: [daemon] High CPU load after update from 1.3.2 to 1.3.3

2023-05-15 Thread John.E.Gregg
Andreas,

Use the java flight recorder to take a recording of a minute or two.  Open it 
in Java Mission Control and look at the method samples.  That will give you a 
good idea where the CPU usage is coming from.  If that doesn't seem helpful, 
maybe enable -XX+DebugNonSafepoints and try again.


> -Original Message-
> From: Andreas Kuhtz 
> Sent: Monday, May 15, 2023 11:25 AM
> To: user@commons.apache.org
> Subject: [daemon] High CPU load after update from 1.3.2 to 1.3.3
> 
> Hi there,
> 
> I see a high CPU load after updating commons-daemon from 1.3.2 to 1.3.3
> (and 1.3.4) on my system.
> The application is a simple SpringBoot application that is started with 
> service-
> user LocalSystem (no difference if started with default value).
> 
> How can I find the cause for this?
> 
> Many thanks,
> Andreas

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



Re: [daemon] High CPU load after update from 1.3.2 to 1.3.3

2023-05-15 Thread Gary Gregory
The statement "high CPU load" is pretty vague. Gathering data on which
processes use what percentage of CPU/cores and disk activity over time
would be a start.

Gary

On Mon, May 15, 2023, 12:25 Andreas Kuhtz  wrote:

> Hi there,
>
> I see a high CPU load after updating commons-daemon from 1.3.2 to 1.3.3
> (and 1.3.4) on my system.
> The application is a simple SpringBoot application that is started with
> service-user LocalSystem (no difference if started with default value).
>
> How can I find the cause for this?
>
> Many thanks,
> Andreas
>


Re: [daemon] Procrun and -javaagent

2022-09-01 Thread Gary Gregory
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  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-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


Re: [daemon] Procrun and -javaagent

2022-08-24 Thread Mladen Turk




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)
How to install Windows agents as a service? - 
CloudBees
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-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [daemon] Procrun and -javaagent

2022-08-20 Thread Martin Gainty
Apparently you can but only as a jenkinsWindowService.exe
How to install Windows agents as a service? 
(cloudbees.com)
How to install Windows agents as a service? - 
CloudBees
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. 
Sent: Friday, August 19, 2022 8:46 AM
To: Commons Users List 
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

2022-08-19 Thread Fernando O.
RTFM to me *  :D

On Fri, Aug 19, 2022 at 12:47 PM Fernando O.  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.  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.  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  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-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




Re: [daemon] Procrun and -javaagent

2022-08-19 Thread Fernando O.
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.  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.  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  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-unsubscr...@commons.apache.org
>>> For additional commands, e-mail: user-h...@commons.apache.org
>>>
>>>


Re: [daemon] Procrun and -javaagent

2022-08-19 Thread Fernando O.
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.  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  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-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
>>


Re: [daemon] Procrun and -javaagent

2022-08-19 Thread Fernando O.
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  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-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


Re: [daemon] Procrun and -javaagent

2022-08-19 Thread Mantas Gridinas
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.  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]
>


Re: [daemon] Procrun and -javaagent

2022-08-19 Thread Mark Thomas

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-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [DAEMON] Updating install image on Windows

2021-12-24 Thread Mark Thomas

On 23/12/2021 16:20, Kauppila Jared wrote:

Hello,

When using 'procrun.exe' to install a service on Windows, you can specify 
'-Install C:/path/to/procrun.exe' to set the imagePath that the service will 
utilize.

I've noticed that updating a service while passing '-install' will not update 
that imagePath and digging into the code verifies this at 
https://github.com/apache/commons-daemon/blob/master/src/native/windows/apps/prunsrv/prunsrv.c#L994


That was clearly a deliberate decision. What isn't clear is why the 
decision was made.



In my scenario, I would like to upgrade the version of Commons Daemon I'm using 
and need to update that imagePath value. Is my only option to delete/install 
the service, or manually edit the registry? Or is there some other command to 
facilitate updating that value?


I don't believe there is a command to do that.

Is another option just to replace the executable with the new version?


Would a PR be accepted to allow updating imagePath via the update command?


I don't see why not, providing that it was shown that updating the image 
path didn't cause any complications. I do wonder how a service would 
react if that was changed while the service was running.


Given that you are going to have to stop the service to update 
procrun.exe, why not stop the service, replace procrun.exe and restart 
the service instead?


Mark

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



RE: [daemon] Escaping the colon

2021-09-16 Thread Gridinas, Mantas
Aye, it's a bit complicated. We deploy to windows server 2012 which runs 
powershell 4, but all of development  is on windows 10 2h02 which runs 
powershell 7. So there might be some disparity there. Still, I am a bit upset 
that windows specific JDKs do not include the integration with windows service 
infrastructure and we need these weird workarounds like apache daemon or NSSM.

-Original Message-
From: Gary Gregory  
Sent: Monday, September 6, 2021 16:26
To: Commons Users List 
Subject: Re: [daemon] Escaping the colon

Windows and Linux shells treat different quotes differently, so that's another 
thing to watch out for when asking questions and answering them ;-)

I have no idea what OS you are on and which one Mark assumed while replying!

Gary

On Mon, Sep 6, 2021, 06:55 Gridinas, Mantas 
wrote:

> Sadly it did not. I've worked around it using the environment 
> variables, which do permit the escaping.
>
> -Original Message-
> From: Gary Gregory 
> Sent: Saturday, August 21, 2021 16:22
> To: Commons Users List 
> Subject: Re: [daemon] Escaping the colon
>
> Did that fix it?
>
> Gary
>
> On Tue, Aug 17, 2021, 03:28 Mark Thomas  wrote:
>
> > Please try again with single quotes rather than double quotes. i.e.
> >
> > -Dfoo='bar;zar'
> >
> > Mark
> >
> >
> > On 17/08/2021 07:43, Gridinas, Mantas wrote:
> > > I did test that prior writing the message. Result was the following:
> > >
> > > -Dfoo=bar
> > > zar
> > >
> > > -Original Message-
> > > From: Gary Gregory 
> > > Sent: Monday, August 16, 2021 19:17
> > > To: Commons Users List 
> > > Subject: Re: [daemon] Escaping the colon
> > >
> > > What happens if you say:
> > >
> > > -Dfoo="bar;zar"
> > >
> > > Gary
> > >
> > > On Mon, Aug 16, 2021, 11:54 Gridinas, Mantas <
> > mantas.gridi...@storebrand.no>
> > > wrote:
> > >
> > >> Hi!
> > >>
> > >> I've come into a bit of a pickle. I'm trying to pass the 
> > >> following value as my argument for a system property 
> > >> -Dfoo=bar;zar Which results in the following usage of 
> > >> ++StartParams
> > >> ++StartParams=-Dfoo=bar;zar
> > >>
> > >> In my JVM I am using `System.getProperty("foo")` to read the the 
> > >> expected value of "bar;zar", but instead procsrv.exe considers 
> > >> that zar should be a different argument which in turn causes the 
> > >> java.exe think that zar is the main class name for application 
> > >> instead. How do I go about escaping the colon in startparams?
> > >>
> > >> Cheers!
> > >> // Mantas
> > >>
> > >
> > > --
> > > --
> > > - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > > For additional commands, e-mail: user-h...@commons.apache.org
> > >
> >
> >
> > 
> > - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > For additional commands, e-mail: user-h...@commons.apache.org
> >
> >
>

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



Re: [daemon] Escaping the colon

2021-09-06 Thread Gary Gregory
Windows and Linux shells treat different quotes differently, so that's
another thing to watch out for when asking questions and answering them ;-)

I have no idea what OS you are on and which one Mark assumed while
replying!

Gary

On Mon, Sep 6, 2021, 06:55 Gridinas, Mantas 
wrote:

> Sadly it did not. I've worked around it using the environment variables,
> which do permit the escaping.
>
> -Original Message-
> From: Gary Gregory 
> Sent: Saturday, August 21, 2021 16:22
> To: Commons Users List 
> Subject: Re: [daemon] Escaping the colon
>
> Did that fix it?
>
> Gary
>
> On Tue, Aug 17, 2021, 03:28 Mark Thomas  wrote:
>
> > Please try again with single quotes rather than double quotes. i.e.
> >
> > -Dfoo='bar;zar'
> >
> > Mark
> >
> >
> > On 17/08/2021 07:43, Gridinas, Mantas wrote:
> > > I did test that prior writing the message. Result was the following:
> > >
> > > -Dfoo=bar
> > > zar
> > >
> > > -Original Message-
> > > From: Gary Gregory 
> > > Sent: Monday, August 16, 2021 19:17
> > > To: Commons Users List 
> > > Subject: Re: [daemon] Escaping the colon
> > >
> > > What happens if you say:
> > >
> > > -Dfoo="bar;zar"
> > >
> > > Gary
> > >
> > > On Mon, Aug 16, 2021, 11:54 Gridinas, Mantas <
> > mantas.gridi...@storebrand.no>
> > > wrote:
> > >
> > >> Hi!
> > >>
> > >> I've come into a bit of a pickle. I'm trying to pass the following
> > >> value as my argument for a system property -Dfoo=bar;zar Which
> > >> results in the following usage of ++StartParams
> > >> ++StartParams=-Dfoo=bar;zar
> > >>
> > >> In my JVM I am using `System.getProperty("foo")` to read the the
> > >> expected value of "bar;zar", but instead procsrv.exe considers that
> > >> zar should be a different argument which in turn causes the
> > >> java.exe think that zar is the main class name for application
> > >> instead. How do I go about escaping the colon in startparams?
> > >>
> > >> Cheers!
> > >> // Mantas
> > >>
> > >
> > > 
> > > - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > > For additional commands, e-mail: user-h...@commons.apache.org
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > For additional commands, e-mail: user-h...@commons.apache.org
> >
> >
>


RE: [daemon] Escaping the colon

2021-09-06 Thread Gridinas, Mantas
Sadly it did not. I've worked around it using the environment variables, which 
do permit the escaping.

-Original Message-
From: Gary Gregory  
Sent: Saturday, August 21, 2021 16:22
To: Commons Users List 
Subject: Re: [daemon] Escaping the colon

Did that fix it?

Gary

On Tue, Aug 17, 2021, 03:28 Mark Thomas  wrote:

> Please try again with single quotes rather than double quotes. i.e.
>
> -Dfoo='bar;zar'
>
> Mark
>
>
> On 17/08/2021 07:43, Gridinas, Mantas wrote:
> > I did test that prior writing the message. Result was the following:
> >
> > -Dfoo=bar
> > zar
> >
> > -Original Message-
> > From: Gary Gregory 
> > Sent: Monday, August 16, 2021 19:17
> > To: Commons Users List 
> > Subject: Re: [daemon] Escaping the colon
> >
> > What happens if you say:
> >
> > -Dfoo="bar;zar"
> >
> > Gary
> >
> > On Mon, Aug 16, 2021, 11:54 Gridinas, Mantas <
> mantas.gridi...@storebrand.no>
> > wrote:
> >
> >> Hi!
> >>
> >> I've come into a bit of a pickle. I'm trying to pass the following 
> >> value as my argument for a system property -Dfoo=bar;zar Which 
> >> results in the following usage of ++StartParams
> >> ++StartParams=-Dfoo=bar;zar
> >>
> >> In my JVM I am using `System.getProperty("foo")` to read the the 
> >> expected value of "bar;zar", but instead procsrv.exe considers that 
> >> zar should be a different argument which in turn causes the 
> >> java.exe think that zar is the main class name for application 
> >> instead. How do I go about escaping the colon in startparams?
> >>
> >> Cheers!
> >> // Mantas
> >>
> >
> > 
> > - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > For additional commands, e-mail: user-h...@commons.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


Re: [daemon] Escaping the colon

2021-08-21 Thread Gary Gregory
Did that fix it?

Gary

On Tue, Aug 17, 2021, 03:28 Mark Thomas  wrote:

> Please try again with single quotes rather than double quotes. i.e.
>
> -Dfoo='bar;zar'
>
> Mark
>
>
> On 17/08/2021 07:43, Gridinas, Mantas wrote:
> > I did test that prior writing the message. Result was the following:
> >
> > -Dfoo=bar
> > zar
> >
> > -Original Message-
> > From: Gary Gregory 
> > Sent: Monday, August 16, 2021 19:17
> > To: Commons Users List 
> > Subject: Re: [daemon] Escaping the colon
> >
> > What happens if you say:
> >
> > -Dfoo="bar;zar"
> >
> > Gary
> >
> > On Mon, Aug 16, 2021, 11:54 Gridinas, Mantas <
> mantas.gridi...@storebrand.no>
> > wrote:
> >
> >> Hi!
> >>
> >> I've come into a bit of a pickle. I'm trying to pass the following
> >> value as my argument for a system property -Dfoo=bar;zar Which results
> >> in the following usage of ++StartParams
> >> ++StartParams=-Dfoo=bar;zar
> >>
> >> In my JVM I am using `System.getProperty("foo")` to read the the
> >> expected value of "bar;zar", but instead procsrv.exe considers that
> >> zar should be a different argument which in turn causes the java.exe
> >> think that zar is the main class name for application instead. How do
> >> I go about escaping the colon in startparams?
> >>
> >> Cheers!
> >> // Mantas
> >>
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > For additional commands, e-mail: user-h...@commons.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


Re: [daemon] Escaping the colon

2021-08-17 Thread Mark Thomas

Please try again with single quotes rather than double quotes. i.e.

-Dfoo='bar;zar'

Mark


On 17/08/2021 07:43, Gridinas, Mantas wrote:

I did test that prior writing the message. Result was the following:

-Dfoo=bar
zar

-Original Message-
From: Gary Gregory 
Sent: Monday, August 16, 2021 19:17
To: Commons Users List 
Subject: Re: [daemon] Escaping the colon

What happens if you say:

-Dfoo="bar;zar"

Gary

On Mon, Aug 16, 2021, 11:54 Gridinas, Mantas 
wrote:


Hi!

I've come into a bit of a pickle. I'm trying to pass the following
value as my argument for a system property -Dfoo=bar;zar Which results
in the following usage of ++StartParams
++StartParams=-Dfoo=bar;zar

In my JVM I am using `System.getProperty("foo")` to read the the
expected value of "bar;zar", but instead procsrv.exe considers that
zar should be a different argument which in turn causes the java.exe
think that zar is the main class name for application instead. How do
I go about escaping the colon in startparams?

Cheers!
// Mantas



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




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



RE: [daemon] Escaping the colon

2021-08-16 Thread Gridinas, Mantas
I did test that prior writing the message. Result was the following:

-Dfoo=bar
zar

-Original Message-
From: Gary Gregory  
Sent: Monday, August 16, 2021 19:17
To: Commons Users List 
Subject: Re: [daemon] Escaping the colon

What happens if you say:

-Dfoo="bar;zar"

Gary

On Mon, Aug 16, 2021, 11:54 Gridinas, Mantas 
wrote:

> Hi!
>
> I've come into a bit of a pickle. I'm trying to pass the following 
> value as my argument for a system property -Dfoo=bar;zar Which results 
> in the following usage of ++StartParams
> ++StartParams=-Dfoo=bar;zar
>
> In my JVM I am using `System.getProperty("foo")` to read the the 
> expected value of "bar;zar", but instead procsrv.exe considers that 
> zar should be a different argument which in turn causes the java.exe 
> think that zar is the main class name for application instead. How do 
> I go about escaping the colon in startparams?
>
> Cheers!
> // Mantas
>

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



Re: [daemon] Escaping the colon

2021-08-16 Thread Gary Gregory
What happens if you say:

-Dfoo="bar;zar"

Gary

On Mon, Aug 16, 2021, 11:54 Gridinas, Mantas 
wrote:

> Hi!
>
> I've come into a bit of a pickle. I'm trying to pass the following value
> as my argument for a system property
> -Dfoo=bar;zar
> Which results in the following usage of ++StartParams
> ++StartParams=-Dfoo=bar;zar
>
> In my JVM I am using `System.getProperty("foo")` to read the the expected
> value of "bar;zar", but instead procsrv.exe considers that zar should be a
> different argument which in turn causes the java.exe think that zar is the
> main class name for application instead. How do I go about escaping the
> colon in startparams?
>
> Cheers!
> // Mantas
>


Re: [daemon] Java9 --add-modules

2021-04-16 Thread Sebastian Götz

Okay I will try answering my own question:

It turned out, that with my configuration (Windows Server 2019 and Adopt 
OpenJDK 11) I needed to specify an additional argument to make the 
localhost JMX connection work.

This is the complete list of arguments used for the JMX server:

-Dcom.sun.management.jmxremote.port=9011
-Dcom.sun.management.jmxremote.host=localhost
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=localhost

With the additional last parameter it worked as before. So this has 
nothing to do with the initial question.


Btw: --add-modules is used in jlink to create a custom image so I was 
complete out of scope with that.


Kind regards

Am 16.04.2021 um 08:35 schrieb Sebastian Götz:

Hello,

I am trying to run my service with procrun as usual. After migration 
to JDK11 I found out, that a connection with jconsole (JMX) is no 
longer possible although the arguments for the JVM are the same as 
before. After some investigation I found out, I have to explicitly 
load the module jdk.management.agent. So I am trying to somewhere get 
the --add-modules jdk.management.agent part into the service config. 
But I have had no success so far. Adding it to the standard JvmOptions 
pane fails with:


[2021-04-16 08:14:49] [debug] ( prunsrv.c:1892) [ 5504] Apache Commons 
Daemon procrun log initialized.
[2021-04-16 08:14:49] [info]  ( prunsrv.c:1896) [ 5504] Apache Commons 
Daemon procrun (1.2.4.0 64-bit) started.
[2021-04-16 08:14:49] [info]  ( prunsrv.c:1806) [ 5504] Running 
Service 'MY_SERVICE'...
[2021-04-16 08:14:49] [debug] ( prunsrv.c:1577) [  164] Inside 
ServiceMain...
[2021-04-16 08:14:49] [debug] ( prunsrv.c:1032) [  164] 
reportServiceStatusE: dwCurrentState = 2, dwWin32ExitCode = 0, 
dwWaitHint = 3000, dwServiceSpecificExitCode = 0.
[2021-04-16 08:14:49] [info]  ( prunsrv.c:1325) [  164] Starting 
service...
[2021-04-16 08:14:49] [debug] ( prunsrv.c:496 ) [  164] Checking Java 
options for environment variable requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164] Checking 
'--add-modules jdk.management.agent' for environment variable requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164] Checking 
'-XX:+UseG1GC' for environment variable requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164] Checking 
'-Dcom.sun.management.jmxremote.port=9011' for environment variable 
requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164] Checking 
'-Dcom.sun.management.jmxremote.host=localhost' for environment 
variable requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164] Checking 
'-Dcom.sun.management.jmxremote.authenticate=false' for environment 
variable requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164] Checking 
'-Dcom.sun.management.jmxremote.ssl=false' for environment variable 
requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164] Checking 
'-Deu.inform.configDir=C:\.mycomp\myapp\config' for environment 
variable requirements
[2021-04-16 08:14:49] [debug] ( javajni.c:216 ) [  164] Explicit 
RuntimeLib specified 'C:\Program 
Files\mycomp\mypath\..\java\bin\server\jvm.dll'
[2021-04-16 08:14:49] [debug] ( javajni.c:280 ) [  164] Adding Java 
bin path to the PATH to fix loading of awt.dll: 'C:\Program 
Files\mycomp\mypath\..\java\bin'
[2021-04-16 08:14:49] [debug] ( javajni.c:286 ) [  164] Loading JVM 
DLL 'C:\Program Files\mycomp\mypath\..\java\bin\server\jvm.dll'
[2021-04-16 08:14:49] [debug] ( javajni.c:414 ) [  164] Loaded JVM DLL 
'C:\Program Files\mycomp\mypath\..\java\bin\server\jvm.dll', home ''.
[2021-04-16 08:14:49] [debug] ( javajni.c:419 ) [  164] 
JNI_GetCreatedJavaVMs...
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[0] 
--add-modules jdk.management.agent
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[1] 
-XX:+UseG1GC
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[2] 
-Dcom.sun.management.jmxremote.port=9011
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[3] 
-Dcom.sun.management.jmxremote.host=localhost
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[4] 
-Dcom.sun.management.jmxremote.authenticate=false
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[5] 
-Dcom.sun.management.jmxremote.ssl=false
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[6] 
-Deu.inform.configDir=C:\.mycomp\myapp\config
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[7] 
-Djava.class.path=myapp.jar

[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[8] exit
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[9] 
abort
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[10] 
-Xms128m
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm Option[11] 
-Xmx819m
[2021-04-16 08:14:49] [error] ( javajni.c:828 ) [  328] CreateJavaVM 
Failed with erro

Re: [daemon] Windows service not starting JVM mode with -javaagent (JDK11)

2021-02-22 Thread Mark Thomas
On 22/02/2021 08:40, Sebastian Götz wrote:
> Okay.
> 
> I got it. It appears that the double quotes are no longer allowed. When
> removing them the service starts:

See the 1.2.0 changelog and https://issues.apache.org/jira/browse/DAEMON-399

Mark

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



Re: [daemon] Windows service not starting JVM mode with -javaagent (JDK11)

2021-02-22 Thread Sebastian Götz

Okay.

I got it. It appears that the double quotes are no longer allowed. When 
removing them the service starts:


[2021-02-22 09:24:34] [debug] ( prunsrv.c:1892) [ 1704] Apache Commons 
Daemon procrun log initialized.
[2021-02-22 09:24:34] [info]  ( prunsrv.c:1896) [ 1704] Apache Commons 
Daemon procrun (1.2.4.0 64-bit) started.
[2021-02-22 09:24:34] [info]  ( prunsrv.c:1806) [ 1704] Running Service 
'MyApp_COMM_SERVER'...
[2021-02-22 09:24:34] [debug] ( prunsrv.c:1577) [  348] Inside 
ServiceMain...
[2021-02-22 09:24:34] [debug] ( prunsrv.c:1032) [  348] 
reportServiceStatusE: dwCurrentState = 2, dwWin32ExitCode = 0, 
dwWaitHint = 3000, dwServiceSpecificExitCode = 0.

[2021-02-22 09:24:34] [info]  ( prunsrv.c:1325) [  348] Starting service...
[2021-02-22 09:24:34] [debug] ( prunsrv.c:496 ) [  348] Checking Java 
options for environment variable requirements
[2021-02-22 09:24:34] [debug] ( prunsrv.c:500 ) [  348] Checking 
'-javaagent:lib\spring-instrument.jar' for environment variable requirements
[2021-02-22 09:24:34] [debug] ( prunsrv.c:500 ) [  348] Checking 
'-XX:+UseG1GC' for environment variable requirements
[2021-02-22 09:24:34] [debug] ( prunsrv.c:500 ) [  348] Checking 
'-Dcom.sun.management.jmxremote.port=9011' for environment variable 
requirements
[2021-02-22 09:24:34] [debug] ( prunsrv.c:500 ) [  348] Checking 
'-Dcom.sun.management.jmxremote.host=localhost' for environment variable 
requirements
[2021-02-22 09:24:34] [debug] ( prunsrv.c:500 ) [  348] Checking 
'-Dcom.sun.management.jmxremote.authenticate=false' for environment 
variable requirements
[2021-02-22 09:24:34] [debug] ( prunsrv.c:500 ) [  348] Checking 
'-Dcom.sun.management.jmxremote.ssl=false' for environment variable 
requirements
[2021-02-22 09:24:34] [debug] ( prunsrv.c:500 ) [  348] Checking 
'-Deu.inform.configDir=C:\.inform\isac3\config' for environment variable 
requirements
[2021-02-22 09:24:34] [debug] ( javajni.c:216 ) [  348] Explicit 
RuntimeLib specified 'C:\Program 
Files\MyApp\isac3-comm\..\java\bin\server\jvm.dll'
[2021-02-22 09:24:34] [debug] ( javajni.c:280 ) [  348] Adding Java bin 
path to the PATH to fix loading of awt.dll: 'C:\Program 
Files\MyApp\isac3-comm\..\java\bin'
[2021-02-22 09:24:34] [debug] ( javajni.c:286 ) [  348] Loading JVM DLL 
'C:\Program Files\MyApp\isac3-comm\..\java\bin\server\jvm.dll'
[2021-02-22 09:24:34] [debug] ( javajni.c:414 ) [  348] Loaded JVM DLL 
'C:\Program Files\MyApp\isac3-comm\..\java\bin\server\jvm.dll', home ''.
[2021-02-22 09:24:34] [debug] ( javajni.c:419 ) [  348] 
JNI_GetCreatedJavaVMs...
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[0] 
-javaagent:lib\spring-instrument.jar
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[1] 
-XX:+UseG1GC
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[2] 
-Dcom.sun.management.jmxremote.port=9011
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[3] 
-Dcom.sun.management.jmxremote.host=localhost
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[4] 
-Dcom.sun.management.jmxremote.authenticate=false
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[5] 
-Dcom.sun.management.jmxremote.ssl=false
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[6] 
-Deu.inform.configDir=C:\.inform\isac3\config
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[7] 
-Djava.class.path=isac3-comm-server.jar

[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[8] exit
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[9] abort
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[10] 
-Xms128m
[2021-02-22 09:24:34] [debug] ( javajni.c:817 ) [ 6564] Jvm Option[11] 
-Xmx819m

[2021-02-22 09:24:38] [debug] ( javajni.c:1003) [ 6564] argv[0] = start
[2021-02-22 09:24:38] [debug] ( javajni.c:1062) [ 6564] Java worker 
thread started for eu/inform/comm/CommServerApplication:main
[2021-02-22 09:24:38] [debug] ( javajni.c:1068) [ 6564] JNI calling 
static void method eu/inform/comm/CommServerApplication:main
[2021-02-22 09:24:39] [debug] ( prunsrv.c:1389) [  348] Java started 
'eu/inform/comm/CommServerApplication'.
[2021-02-22 09:24:39] [info]  ( prunsrv.c:1488) [  348] Service started 
in 4155 milliseconds.
[2021-02-22 09:24:39] [debug] ( prunsrv.c:1032) [  348] 
reportServiceStatusE: dwCurrentState = 4, dwWin32ExitCode = 0, 
dwWaitHint = 0, dwServiceSpecificExitCode = 0.
[2021-02-22 09:24:39] [debug] ( prunsrv.c:1732) [  348] Waiting for 
worker to finish...
[2021-02-22 09:24:39] [debug] ( javajni.c:1157) [  348] 
WaitForSingleObject 0x0264 -1 milliseconds (INFINITE=-1)...


Thank you.


Am 22.02.2021 um 07:59 schrieb Sebastian Götz:

I am sorry for the delay but here is the requested information.

The application worked fine as a Windows service with the following 
configuration:


  * Windows Server 2019 (Version 1809 Build 17763.437)
  * Oracle JDK 8.0.1020.14 (aka JDK

Re: [daemon] Windows service not starting JVM mode with -javaagent (JDK11)

2021-02-21 Thread Sebastian Götz

I am sorry for the delay but here is the requested information.

The application worked fine as a Windows service with the following 
configuration:


 * Windows Server 2019 (Version 1809 Build 17763.437)
 * Oracle JDK 8.0.1020.14 (aka JDK 8 u 102)
 * Procrun 1.0.15.0

After upgrading the configuration to

 * OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9.1+1, mixed mode)
 * Procrun 1.2.4.0

the services won't start anymore. In the service configuration dialog I 
already have set the Level to DEBUG on the Logging tab.
This is the sole output when trying to start the service (note that I 
had to hide some customer details manually in the logs):


[2021-02-22 07:53:22] [debug] ( prunsrv.c:1892) [ 5988] Apache Commons 
Daemon procrun log initialized.
[2021-02-22 07:53:23] [info]  ( prunsrv.c:1896) [ 5988] Apache Commons 
Daemon procrun (1.2.4.0 64-bit) started.
[2021-02-22 07:53:23] [info]  ( prunsrv.c:1806) [ 5988] Running Service 
'MyApp_COMM_SERVER'...
[2021-02-22 07:53:23] [debug] ( prunsrv.c:1577) [ 5040] Inside 
ServiceMain...
[2021-02-22 07:53:23] [debug] ( prunsrv.c:1032) [ 5040] 
reportServiceStatusE: dwCurrentState = 2, dwWin32ExitCode = 0, 
dwWaitHint = 3000, dwServiceSpecificExitCode = 0.

[2021-02-22 07:53:23] [info]  ( prunsrv.c:1325) [ 5040] Starting service...
[2021-02-22 07:53:23] [debug] ( prunsrv.c:496 ) [ 5040] Checking Java 
options for environment variable requirements
[2021-02-22 07:53:23] [debug] ( prunsrv.c:500 ) [ 5040] Checking 
'-javaagent:"lib/spring-instrument.jar"' for environment variable 
requirements
[2021-02-22 07:53:23] [debug] ( prunsrv.c:500 ) [ 5040] Checking 
'-XX:+UseG1GC' for environment variable requirements
[2021-02-22 07:53:23] [debug] ( prunsrv.c:500 ) [ 5040] Checking 
'-Dcom.sun.management.jmxremote.port=9011' for environment variable 
requirements
[2021-02-22 07:53:23] [debug] ( prunsrv.c:500 ) [ 5040] Checking 
'-Dcom.sun.management.jmxremote.host=localhost' for environment variable 
requirements
[2021-02-22 07:53:23] [debug] ( prunsrv.c:500 ) [ 5040] Checking 
'-Dcom.sun.management.jmxremote.authenticate=false' for environment 
variable requirements
[2021-02-22 07:53:23] [debug] ( prunsrv.c:500 ) [ 5040] Checking 
'-Dcom.sun.management.jmxremote.ssl=false' for environment variable 
requirements
[2021-02-22 07:53:23] [debug] ( prunsrv.c:500 ) [ 5040] Checking 
'-Deu.inform.configDir=C:\.inform\isac3\config' for environment variable 
requirements
[2021-02-22 07:53:23] [debug] ( javajni.c:216 ) [ 5040] Explicit 
RuntimeLib specified 'C:\Program 
Files\MyApp\isac3-comm\..\java\bin\server\jvm.dll'
[2021-02-22 07:53:23] [debug] ( javajni.c:280 ) [ 5040] Adding Java bin 
path to the PATH to fix loading of awt.dll: 'C:\Program 
Files\MyApp\isac3-comm\..\java\bin'
[2021-02-22 07:53:23] [debug] ( javajni.c:286 ) [ 5040] Loading JVM DLL 
'C:\Program Files\MyApp\isac3-comm\..\java\bin\server\jvm.dll'
[2021-02-22 07:53:23] [debug] ( javajni.c:414 ) [ 5040] Loaded JVM DLL 
'C:\Program Files\MyApp\isac3-comm\..\java\bin\server\jvm.dll', home ''.
[2021-02-22 07:53:23] [debug] ( javajni.c:419 ) [ 5040] 
JNI_GetCreatedJavaVMs...
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[0] 
-javaagent:"lib/spring-instrument.jar"
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[1] 
-XX:+UseG1GC
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[2] 
-Dcom.sun.management.jmxremote.port=9011
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[3] 
-Dcom.sun.management.jmxremote.host=localhost
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[4] 
-Dcom.sun.management.jmxremote.authenticate=false
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[5] 
-Dcom.sun.management.jmxremote.ssl=false
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[6] 
-Deu.inform.configDir=C:\.inform\isac3\config
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[7] 
-Djava.class.path=isac3-comm-server.jar

[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[8] exit
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[9] abort
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[10] 
-Xms128m
[2021-02-22 07:53:23] [debug] ( javajni.c:817 ) [ 4644] Jvm Option[11] 
-Xmx819m

[2021-02-22 07:53:23] [debug] ( javajni.c:573 ) [ 4644] JVM aborted
[2021-02-22 07:53:23] [debug] ( prunsrv.c:1108) [ 4644] Start exit hook 
called...

[2021-02-22 07:53:23] [debug] ( prunsrv.c:1109) [ 4644] JVM exit code: 1.

Kind regards

Sebastian


Am 12.02.2021 um 13:50 schrieb Gary Gregory:

Also enable debug logging.

Gary

On Fri, Feb 12, 2021, 06:48 Mark Thomas  wrote:


Please can you be specific about exactly which JVM versions and Procrun
versions you tested and which worked and which did not?

Thanks,

Mark


On 12/02/2021 10:38, Sebastian Götz wrote:

Hi all,

I have an issue when I try upgrading my existing application.
For years I have been using procrun 

Re: [daemon] Windows service not starting JVM mode with -javaagent (JDK11)

2021-02-12 Thread Hugo Ferreira



Open or Oracle JDK?

Colleague had some issue launching a process in Windows (Oracle JDK).
In linux + OpenJDK no problem.
Error was from the Java library.

 java.io.IOException: Cannot run program "java" (in directory 
"C:\Users\\IdeaProjects\toyadmos"): CreateProcess error=206, The 
filename or extension is too long

java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
os.proc.proc$lzycompute$1(ProcessOps.scala:128)
os.proc.proc$1(ProcessOps.scala:122)
os.proc.spawn(ProcessOps.scala:135)


Solved by not forking.

See this:
https://github.com/microsoft/vscode-java-debug/issues/110#issuecomment-679972016

HTHs

On 12/02/21 10:38, Sebastian Götz wrote:

Hi all,

I have an issue when I try upgrading my existing application.
For years I have been using procrun to install and start the application 
as a Windows service.
No it seems that there is some sort of compatibility problem. My 
application is compiled with JDK 11 and also run with JDK 11.
It is configured to run in JVM mode. Now comes the main issue: it makes 
use of load time weaving (AspectJ). For this I need to install a Java 
agent in order to register a class transformer. I use Spring's 
instrumentation support package (spring-instrument.jar) for this. When I 
change the JvmOptions in the service configuration to add the javaagent 
like this:


-javaagent:"lib/spring-instrument.jar"

It stops working. The service does not start and Windows event viewer 
states that my service has crashed. I see no log message giving my any 
hint where to start searching. Initially I used Version 1.1.0.0 of 
procrun, but even with the recent 1.2.4 the problem persists. I double 
checked the path to the jar file and even tried with the absolute path 
in case the working directory would not match. I used the exact same 
configuration formerly for this application using Oracle JDK 8. Is there 
a known issue with OpenJDK 11 I am not aware of?


Kind regards
Sebastian Götz





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



Re: [daemon] Windows service not starting JVM mode with -javaagent (JDK11)

2021-02-12 Thread Gary Gregory
Also enable debug logging.

Gary

On Fri, Feb 12, 2021, 06:48 Mark Thomas  wrote:

> Please can you be specific about exactly which JVM versions and Procrun
> versions you tested and which worked and which did not?
>
> Thanks,
>
> Mark
>
>
> On 12/02/2021 10:38, Sebastian Götz wrote:
> > Hi all,
> >
> > I have an issue when I try upgrading my existing application.
> > For years I have been using procrun to install and start the application
> > as a Windows service.
> > No it seems that there is some sort of compatibility problem. My
> > application is compiled with JDK 11 and also run with JDK 11.
> > It is configured to run in JVM mode. Now comes the main issue: it makes
> > use of load time weaving (AspectJ). For this I need to install a Java
> > agent in order to register a class transformer. I use Spring's
> > instrumentation support package (spring-instrument.jar) for this. When I
> > change the JvmOptions in the service configuration to add the javaagent
> > like this:
> >
> > -javaagent:"lib/spring-instrument.jar"
> >
> > It stops working. The service does not start and Windows event viewer
> > states that my service has crashed. I see no log message giving my any
> > hint where to start searching. Initially I used Version 1.1.0.0 of
> > procrun, but even with the recent 1.2.4 the problem persists. I double
> > checked the path to the jar file and even tried with the absolute path
> > in case the working directory would not match. I used the exact same
> > configuration formerly for this application using Oracle JDK 8. Is there
> > a known issue with OpenJDK 11 I am not aware of?
> >
> > Kind regards
> > Sebastian Götz
> >
> >
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


Re: [daemon] Windows service not starting JVM mode with -javaagent (JDK11)

2021-02-12 Thread Mark Thomas
Please can you be specific about exactly which JVM versions and Procrun
versions you tested and which worked and which did not?

Thanks,

Mark


On 12/02/2021 10:38, Sebastian Götz wrote:
> Hi all,
> 
> I have an issue when I try upgrading my existing application.
> For years I have been using procrun to install and start the application
> as a Windows service.
> No it seems that there is some sort of compatibility problem. My
> application is compiled with JDK 11 and also run with JDK 11.
> It is configured to run in JVM mode. Now comes the main issue: it makes
> use of load time weaving (AspectJ). For this I need to install a Java
> agent in order to register a class transformer. I use Spring's
> instrumentation support package (spring-instrument.jar) for this. When I
> change the JvmOptions in the service configuration to add the javaagent
> like this:
> 
> -javaagent:"lib/spring-instrument.jar"
> 
> It stops working. The service does not start and Windows event viewer
> states that my service has crashed. I see no log message giving my any
> hint where to start searching. Initially I used Version 1.1.0.0 of
> procrun, but even with the recent 1.2.4 the problem persists. I double
> checked the path to the jar file and even tried with the absolute path
> in case the working directory would not match. I used the exact same
> configuration formerly for this application using Oracle JDK 8. Is there
> a known issue with OpenJDK 11 I am not aware of?
> 
> Kind regards
> Sebastian Götz
> 
> 


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



Re: [daemon] Daemon Logfile Rotation on Windows

2020-11-02 Thread Mark Thomas
On 02/11/2020 12:20, JP wrote:
> Hello,
> 
> I am searching for any documentation on Daemon / Procrun Logfile
> Rotation. As there is not much in the official documentation, I'd like
> to ask you my questions.
> 
> From observation it seems like the Procrun log itself and also StdOutput
> and StdError are rotated at service startup. Ok, not really rotated but
> on each restart a new logfile with a date suffix -MM-DD is created
> and used. Is this correct?

Correct.

> The more important question, is there any mechanism in place which
> deletes older logfiles after a certain time period? And what time period
> is used there?

No. N/A.

The expectation is that applications use a logging framework rather than
log directly to stdout / stderr. The volume of logging to those
destinations is expected is be sufficiently small that rotation is not
necessary.

Mark

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



Re: [daemon] Output systemd-coredump on CentOS8.1

2020-06-12 Thread Gary Gregory
On Fri, Jun 12, 2020 at 4:27 AM 荒井元成  wrote:

>
>
> Thanks for your e-mail.
>
>
>
> I updated to the current version. (ver1.2.2)
>
> But still error.
>
>
>
> Please tell me the procedure to turn on debug.
>

https://commons.apache.org/proper/commons-daemon/jsvc.html

Gary


>
>
>
> >If you turn on debug logging, we might see more interesting output. Also,
>
> >you should be using the current version, which is what we would fix if
>
> >there were something to fix or adjust. I would start by updating to the
>
> >current version.
>
>
>
>
>
>


RE: [daemon] Output systemd-coredump on CentOS8.1

2020-06-12 Thread 荒井元成
 

Thanks for your e-mail.

 

I updated to the current version. (ver1.2.2)

But still error.

 

Please tell me the procedure to turn on debug.

 

>If you turn on debug logging, we might see more interesting output. Also,

>you should be using the current version, which is what we would fix if

>there were something to fix or adjust. I would start by updating to the

>current version.

 

 



Re: [daemon] Output systemd-coredump on CentOS8.1

2020-06-11 Thread Gary Gregory
If you turn on debug logging, we might see more interesting output. Also,
you should be using the current version, which is what we would fix if
there were something to fix or adjust. I would start by updating to the
current version.

Gary

On Thu, Jun 11, 2020 at 7:09 AM 荒井元成  wrote:

>
>
> I have a favor to ask you.
>
>
>
> I'm using apache-commons-deamon 1.0.15.
>
> When running on CentOS 8.1, the following error is output.
>
>
>
> Jun 11 09:00:04 cent8kensho1 user.crit systemd-coredump 4204 Process 2909
> (jsvc) of user 10500 dumped core.#012#012Stack trace of thread 2909:#012#0
> 0x7f237f105718 waitpid (libpthread.so.0)#012#1  0x00404172
> run_controller (jsvc)#012#2  0x00404088 main (jsvc)#012#3
> 0x7f237ed53873 __libc_start_main (libc.so.6)#012#4  0x00401bce
> _start (jsvc)
>
>
>
> Please tell me the cause and how to deal with it.
>
>
>
>
>
>


Re: [daemon] Procrun UnsatisfiedLinkError with JNI project

2020-05-12 Thread Adam Retter
> Maybe try running the service as the same user as the one you use when
> running from the command line. That should help narrow down what is
> going on.


Sorry, I should have mentioned that I had already tried that, and that
it made no difference.

> >> I guess check the obvious. Does the dll exist where the app is looking?
> >
> > It does exist yes. I have a working theory in fact that it loads the
> > DLL, but it is the dependencies of that DLL (which will be various
> > Windows system DLL's) that it can't load.
>
> Is there a tool (ProcessMonitor?) that you can use to monitor attempts
> to load DLLs?

What an amazing little tool. Thank you! I found it here -
https://docs.microsoft.com/en-us/sysinternals/downloads/procmon

I was able to configure it to just monitor prunsrv.exe, and then I
just tried to start my service from the Windows Service Manager.
It generated a lot of information, but once I dug through it, it was
very obvious what was happening.

The short of it, is that there is no problem with Procrun.

The long of it...

The problem was that we ship two versions of the DLL native library
with the application, and each of those is wrapped inside a distinct
jar file, e.g. ourlib.jar and ourlib-debug.jar. The debug version is
there should we have any problems and we need to enable it to get
further information.

When starting our application standalone (i.e. NOT as a service), it
uses Codehaus's AppAssembler Booter which tightly controls what is on
the classpath from a list inside an XML file. The debug version of the
Jar is NOT on that list.

For running the application as a service we had set
`--Classpath="C:/Program Files/FusionDB Server/lib/*"` to prunsrv when
we installed the service. When we subsequently started the application
via the Service, both production and debug versions of the ourlib jar,
were loaded to the classpath. As those ourlib jars contain the same
package and class names, we can't guess which will be chosen when we
ask for one. At runtime Java was deciding to use the debug version and
not the production version. The debug version of the DLL native
library has an additional dependency on MSVCP140D.dll. The
MSVCP140D.dll (the 'D' is for debug) is not part of the standard
Microsoft Visual C++ redistributable package that is often installed,
it is only available as part of Visual Studio! This also explains why
we did not see this issue on our development machines! See -
https://docs.microsoft.com/en-us/cpp/windows/preparing-a-test-machine-to-run-a-debug-executable?view=vs-2019

Whilst the problem was ultimately with our use of the classpath...
this one was a tricky one to diagnise and so I have included the
details here in-case anyone else hits a similar issue with Procrun in
future.

p.s. Thanks for all the help Mark :-)


Cheers Adam.

-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

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



Re: [daemon] Procrun UnsatisfiedLinkError with JNI project

2020-05-12 Thread Bernd Eckenfels
Hello,

You can create a new service with any binary you want to run. This will not 
answer service control commands, so it will fail to respond, but the binary is 
started and can do your testing. You just won't get desktop access. (This is 
similar to what psexec does).

I would suspect context specific things like PATH or generally environment, 
registry, possibly certificates and of course access to UNC or mounted 
directories (and desktop session) be affected by local system.

Gruss
Bernd
--
http://bernd.eckenfels.net

Von: Adam Retter 
Gesendet: Tuesday, May 12, 2020 4:15:32 PM
An: Commons Users List 
Betreff: Re: [daemon] Procrun UnsatisfiedLinkError with JNI project

Thanks for your response Mark, further comments inline below -

> It shouldn't.
>
> Maybe a permissions problem? Although running as LocalService is should
> be fine.

So I am using the `--ServiceUser=LocalSystem` flag - to run under the
LocalSystem account. (i.e. NOT `NT Authority\Local Service`).

> I guess check the obvious. Does the dll exist where the app is looking?

It does exist yes. I have a working theory in fact that it loads the
DLL, but it is the dependencies of that DLL (which will be various
Windows system DLL's) that it can't load.

> Can LocalSystem read that file etc.

Do you know - Is there someway that I can directly execute code under
"LocalSystem" to see if I can reproduce the problem outside of
Procrun?




--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

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



Re: [daemon] Procrun UnsatisfiedLinkError with JNI project

2020-05-12 Thread Mark Thomas
On 12/05/2020 15:15, Adam Retter wrote:
> Thanks for your response Mark, further comments inline below -
> 
>> It shouldn't.
>>
>> Maybe a permissions problem? Although running as LocalService is should
>> be fine.
> 
> So I am using the `--ServiceUser=LocalSystem` flag - to run under the
> LocalSystem account. (i.e. NOT `NT Authority\Local Service`).

Sorry. I knew that and still typed it wrong.

LocalSystem is a member of the local administrators group so it should
be able to read the file.

Maybe try running the service as the same user as the one you use when
running from the command line. That should help narrow down what is
going on.

>> I guess check the obvious. Does the dll exist where the app is looking?
> 
> It does exist yes. I have a working theory in fact that it loads the
> DLL, but it is the dependencies of that DLL (which will be various
> Windows system DLL's) that it can't load.

Is there a tool (ProcessMonitor?) that you can use to monitor attempts
to load DLLs?

>> Can LocalSystem read that file etc.
> 
> Do you know - Is there someway that I can directly execute code under
> "LocalSystem" to see if I can reproduce the problem outside of
> Procrun?

I'd go the other way and run procrun under the user you know works on
the command line.

Mark

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



Re: [daemon] Procrun UnsatisfiedLinkError with JNI project

2020-05-12 Thread Adam Retter
Thanks for your response Mark, further comments inline below -

> It shouldn't.
>
> Maybe a permissions problem? Although running as LocalService is should
> be fine.

So I am using the `--ServiceUser=LocalSystem` flag - to run under the
LocalSystem account. (i.e. NOT `NT Authority\Local Service`).

> I guess check the obvious. Does the dll exist where the app is looking?

It does exist yes. I have a working theory in fact that it loads the
DLL, but it is the dependencies of that DLL (which will be various
Windows system DLL's) that it can't load.

> Can LocalSystem read that file etc.

Do you know - Is there someway that I can directly execute code under
"LocalSystem" to see if I can reproduce the problem outside of
Procrun?




-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

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



Re: [daemon] Does prunsrv only run under Administrator account?

2020-05-12 Thread Adam Retter
Okay thanks Mark, it's good to know that it isn't something that I am
doing/configuring wrong.

On Tue, 12 May 2020 at 15:25, Mark Thomas  wrote:
>
> On 12/05/2020 11:25, Adam Retter wrote:
> > I am seeing different behaviour when running prunsrv either as an
> > Administrator or not. I have seen this in the past and it has bothered
> > me, but I thought it was about time to get to the bottom of it!
> >
> > Starting from a clean install of Windows 2012 Server Base, if I login
> > as my user account `aretter` which is a member-of the `Administrators`
> > group...
> >
> > 1. Launch "Command Prompt" from the Windows Start Menu, then execute
> > `prunsrv.exe //?`. I get a dialog asking if I want to allow the
> > program to make changes to my computer, clicking "Yes" then briefly
> > flashes a second black console screen before returning me to the
> > original cmd.exe with absolutely no output, i.e. I see just this on
> > the cmd.exe
> >
> > c:\tools\bin>prunsrv.exe //?
> >
> > c:\tools\bin>
> >
> >
> > 2. Right-click on "Command Prompt" in the Windows Start Menu, and
> > click "Run as adminstrator", accept the warning, then execute
> > `prunsrv.exe //?`. I get no security dialog, and I get the expected
> > help message printed on the console:
> >
> > C:\Program Files\FusionDB Server\bin>prunsrv.exe //?
> > Usage: prunsrv command [ServiceName] [--options]
> >   Commands:
> >   help   This page
> >   install [ServiceName]  Install Service
> >   update  [ServiceName]  Update Service parameters
> >   delete  [ServiceName]  Delete Service
> >   start   [ServiceName]  Start Service
> >   stop[ServiceName]  Stop Service
> >   run [ServiceName]  Run Service as console application
> >   pause   [Num Seconds]  Sleep for n Seconds (defaults to 60)
> >   versionDisplay version
> >   Options:
> > ...
> >
> >
> > So I am wondering what the difference is, and why I don't get anything
> > in (1)? Do you have to run prunsrv as THE Administrator?
>
> That is the User Account Control feature getting in the way. Even if the
> user is in the administrators group, you don't get full admin privs. My
> understanding is that this is by design
>
> I don't generally run prunsrv directly but if I did I'd run if from a
> command prompt started via "Run as Administrator"
>
> Mark
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>


-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

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



Re: [daemon] Procrun UnsatisfiedLinkError with JNI project

2020-05-12 Thread Mark Thomas
On 12/05/2020 11:40, Adam Retter wrote:
> Hi there,
> 
> I have a Java project which is using JNI to load a native library. I
> would like to install it as a Windows service.
> 
> To install it I am running:
> 
> prunsrv.exe install FusionDB-Server --DisplayName=FusionDB-Server
> --Description="FusionDB Server" --StdError=auto --StdOutput=auto
> --LogPath="C:\Users\aretter\AppData\Roaming\FusionDB Server\logs"
> --LogPrefix=service --PidFile=service.pid --Startup=auto
> --ServiceUser=LocalSystem --Jvm="C:\Program
> Files\BellSoft\LibericaJRE-11-Full\bin\client\jvm.dll"
> --Classpath="C:/Program Files/FusionDB Server/lib/*" --JvmMs=128m
> --StartMode=jvm --StartClass=org.exist.service.ExistDbDaemon
> --StartMethod=start --StopMode=jvm
> --StopClass=org.exist.service.ExistDbDaemon --StopMethod=stop
> --JvmOptions="-Dfile.encoding=UTF-8;-Dlog4j.configurationFile=C:\Program
> Files\FusionDB Server/etc/log4j2.xml;-Djetty.home=C:\Program
> Files\FusionDB Server;-Dexist.jetty.config=C:\Program Files\FusionDB
> Server/etc/jetty/standard.enabled-jetty-configs;-Djetty.git.hash=ab228fde9e55e9164c738d7fa121f8ac5acd51c9;-Dexist.home=C:\Program
> Files\FusionDB Server;-Dexist.configurationFile=C:\Program
> Files\FusionDB Server/etc/conf.xml" --StartParams="C:\Program
> Files\FusionDB Server\etc\conf.xml" --JvmMx=4224m"
> 
> 
> However, when I then try and start the Service for my application, my
> application raises an error when it tries to load the native library
> via Java's System.load(absolutePathToLib) and fails to start up:
> 
> Caused by: java.lang.UnsatisfiedLinkError:
> C:\Windows\Temp\librocksdbjni18005926251924699790.dll: Can't find
> dependent libraries
> at java.lang.ClassLoader$NativeLibrary.load0(Native Method) ~[?:?]
> at java.lang.ClassLoader$NativeLibrary.load(Unknown Source) ~[?:?]
> at java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source) ~[?:?]
> at java.lang.ClassLoader.loadLibrary0(Unknown Source) ~[?:?]
> at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:?]
> at java.lang.Runtime.load0(Unknown Source) ~[?:?]
> at java.lang.System.load(Unknown Source) ~[?:?]
> at 
> org.rocksdb.NativeLibraryLoader.loadLibraryFromJar(NativeLibraryLoader.java:79)
> ~[rocksdbjni-202004011324-patched-debug.jar:?]
> 
> If I run my application directly, i.e. not via the Service, then it is
> able to correctly load the native library and start's up ok.
> 
> I have tested this on both Windows Server 2012 and 2019 with both JRE
> 8 and JRE 11.
> 
> Are there limitations on loading native libraries (or their
> dependencies) from a Java Application started from a Procrun service?
> I am also using StartMode "jvm" perhaps that has some limitation in this area?

It shouldn't.

Maybe a permissions problem? Although running as LocalService is should
be fine.

I guess check the obvious. Does the dll exist where the app is looking?
Can LocalSystem read that file etc.

Mark

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



Re: [daemon] Does prunsrv only run under Administrator account?

2020-05-12 Thread Mark Thomas
On 12/05/2020 11:25, Adam Retter wrote:
> I am seeing different behaviour when running prunsrv either as an
> Administrator or not. I have seen this in the past and it has bothered
> me, but I thought it was about time to get to the bottom of it!
> 
> Starting from a clean install of Windows 2012 Server Base, if I login
> as my user account `aretter` which is a member-of the `Administrators`
> group...
> 
> 1. Launch "Command Prompt" from the Windows Start Menu, then execute
> `prunsrv.exe //?`. I get a dialog asking if I want to allow the
> program to make changes to my computer, clicking "Yes" then briefly
> flashes a second black console screen before returning me to the
> original cmd.exe with absolutely no output, i.e. I see just this on
> the cmd.exe
> 
> c:\tools\bin>prunsrv.exe //?
> 
> c:\tools\bin>
> 
> 
> 2. Right-click on "Command Prompt" in the Windows Start Menu, and
> click "Run as adminstrator", accept the warning, then execute
> `prunsrv.exe //?`. I get no security dialog, and I get the expected
> help message printed on the console:
> 
> C:\Program Files\FusionDB Server\bin>prunsrv.exe //?
> Usage: prunsrv command [ServiceName] [--options]
>   Commands:
>   help   This page
>   install [ServiceName]  Install Service
>   update  [ServiceName]  Update Service parameters
>   delete  [ServiceName]  Delete Service
>   start   [ServiceName]  Start Service
>   stop[ServiceName]  Stop Service
>   run [ServiceName]  Run Service as console application
>   pause   [Num Seconds]  Sleep for n Seconds (defaults to 60)
>   versionDisplay version
>   Options:
> ...
> 
> 
> So I am wondering what the difference is, and why I don't get anything
> in (1)? Do you have to run prunsrv as THE Administrator?

That is the User Account Control feature getting in the way. Even if the
user is in the administrators group, you don't get full admin privs. My
understanding is that this is by design

I don't generally run prunsrv directly but if I did I'd run if from a
command prompt started via "Run as Administrator"

Mark

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



Re: [daemon] prunsrv x64 1.2.0 doesn't start under local service account

2019-09-02 Thread Mark Thomas
On 02/09/2019 09:00, Adam Retter wrote:
> Hi Mark, thanks for your response. I am just wondering when you say:
> 
>> If your application doesn't run under LocalService and you want it to
>> then you'll need to fix your application.
> 
> How can we diagnose why Procrun won't start our application under
> LocalService? We would like to understand what it is about our
> application that stops Procrun from starting it as a LocalService?
> 
> Our application installs into C:\Program Files\, and has
> a data directory in C:\Users\\AppData\Roaming\ data dir>

It is most likely a permissions issue. LocalService has a lot less
access than LocalSystem.

Review the application error logs for permissions related issues and
address them as you find them. The nature of the application may be that
it needs a dedicated (domain or local) user to run under to ensure it
gets only the permissions it needs.

Mark

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



Re: [daemon] prunsrv x64 1.2.0 doesn't start under local service account

2019-09-02 Thread Adam Retter
Hi Mark, thanks for your response. I am just wondering when you say:

> If your application doesn't run under LocalService and you want it to
> then you'll need to fix your application.

How can we diagnose why Procrun won't start our application under
LocalService? We would like to understand what it is about our
application that stops Procrun from starting it as a LocalService?

Our application installs into C:\Program Files\, and has
a data directory in C:\Users\\AppData\Roaming\


-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

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



Re: [daemon] prunsrv x64 1.2.0 doesn't start under local service account

2019-09-01 Thread Mark Thomas
On 31/08/2019 14:40, Adam Retter wrote:
> I note in the release notes for 1.2.0 it states:
> 
>  - The default Windows service user has changed from LocalSystem to
>   'NT Authority\LocalService'
> 
> Could this be the problem that I am experiencing? How can I switch
> back to LocalSystem?



>>> Ideally we don't want to run under the `Local System Account` we want
>>> to use the `local service account` instead. This seemed to work well
>>> with version 1.1.0 but is not working for us with version 1.2.0.

The above statements are contradictory.

1.1.0 uses LocalSystem by default
1.2.0 uses LocalService by default

If you want to use a different user then you are free to change via the
Windows Service Manager, prunmgr or any other available method.

If your application doesn't run under LocalService and you want it to
then you'll need to fix your application.

Mark


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



Re: [daemon] prunsrv x64 1.2.0 doesn't start under local service account

2019-08-31 Thread Adam Retter
I note in the release notes for 1.2.0 it states:

 - The default Windows service user has changed from LocalSystem to
  'NT Authority\LocalService'

Could this be the problem that I am experiencing? How can I switch
back to LocalSystem?

On Sat, 31 Aug 2019 at 00:22, Adam Retter  wrote:
>
> I should add that we are intentionally NOT specifying either `--User`
> or `--ServiceUser` when installing the service via prunsrv x64.
>
> On Sat, 31 Aug 2019 at 00:18, Adam Retter  wrote:
> >
> > After just updating from prunsrv x64 1.1.0 to 1.2.0, we are finding
> > that prunsrv will no longer start our service under the "local service
> > account".
> >
> > It is very strange, as if I launch a cmd.exe as the Administrator
> > User, and run `prunsrv //TS/FusionDB-Server` then it starts up
> > correctly on the console.
> >
> > However if we run `prunsrv //ES/FusionDB-Server` then we see the
> > following errors in service.log:
> >
> > [2019-08-30 23:06:04] [info]  [ 5336] Starting service 'FusionDB-Server'...
> > [2019-08-30 23:06:08] [error] [ 5336] apxServiceControl(): dwState(4)
> > != dwCurrentState(1); dwWin32ExitCode = 0, dwWaitHint = 0,
> > dwServiceSpecificExitCode = 0
> > [2019-08-30 23:06:08] [error] [ 5336] apxServiceControl(): returning FALSE
> > [2019-08-30 23:06:08] [error] [ 5336] Failed to start service 
> > 'FusionDB-Server'.
> > [2019-08-30 23:06:08] [info]  [ 5336] Finished starting service
> > 'FusionDB-Server', returning 0.
> > [2019-08-30 23:06:08] [error] [ 5336] Apache Commons Daemon procrun
> > failed with exit value: 5 (failed to start service).
> >
> > If however we use the Windows Service Manager to modify the service to
> > run under the "Local System Account" (see attached screenshot), then
> > after that, running `prunsrv //ES/FusionDB-Server` starts the service
> > correctly.
> >
> > Ideally we don't want to run under the `Local System Account` we want
> > to use the `local service account` instead. This seemed to work well
> > with version 1.1.0 but is not working for us with version 1.2.0.
> >
> > Thanks and please can you help us...
> >
> > We are testing on Windows 10 x64.
> >
> > --
> > Adam Retter
> >
> > skype: adam.retter
> > tweet: adamretter
> > http://www.adamretter.org.uk
>
>
>
> --
> Adam Retter
>
> skype: adam.retter
> tweet: adamretter
> http://www.adamretter.org.uk



-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

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



Re: [daemon] prunsrv x64 1.2.0 doesn't start under local service account

2019-08-30 Thread Adam Retter
I should add that we are intentionally NOT specifying either `--User`
or `--ServiceUser` when installing the service via prunsrv x64.

On Sat, 31 Aug 2019 at 00:18, Adam Retter  wrote:
>
> After just updating from prunsrv x64 1.1.0 to 1.2.0, we are finding
> that prunsrv will no longer start our service under the "local service
> account".
>
> It is very strange, as if I launch a cmd.exe as the Administrator
> User, and run `prunsrv //TS/FusionDB-Server` then it starts up
> correctly on the console.
>
> However if we run `prunsrv //ES/FusionDB-Server` then we see the
> following errors in service.log:
>
> [2019-08-30 23:06:04] [info]  [ 5336] Starting service 'FusionDB-Server'...
> [2019-08-30 23:06:08] [error] [ 5336] apxServiceControl(): dwState(4)
> != dwCurrentState(1); dwWin32ExitCode = 0, dwWaitHint = 0,
> dwServiceSpecificExitCode = 0
> [2019-08-30 23:06:08] [error] [ 5336] apxServiceControl(): returning FALSE
> [2019-08-30 23:06:08] [error] [ 5336] Failed to start service 
> 'FusionDB-Server'.
> [2019-08-30 23:06:08] [info]  [ 5336] Finished starting service
> 'FusionDB-Server', returning 0.
> [2019-08-30 23:06:08] [error] [ 5336] Apache Commons Daemon procrun
> failed with exit value: 5 (failed to start service).
>
> If however we use the Windows Service Manager to modify the service to
> run under the "Local System Account" (see attached screenshot), then
> after that, running `prunsrv //ES/FusionDB-Server` starts the service
> correctly.
>
> Ideally we don't want to run under the `Local System Account` we want
> to use the `local service account` instead. This seemed to work well
> with version 1.1.0 but is not working for us with version 1.2.0.
>
> Thanks and please can you help us...
>
> We are testing on Windows 10 x64.
>
> --
> Adam Retter
>
> skype: adam.retter
> tweet: adamretter
> http://www.adamretter.org.uk



-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

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



Re: [daemon] after updating prunsrv to 1.2.0 on Windows - The Service doesn't start

2019-08-30 Thread Mark Thomas
Known issue with 32-bit processes.

You can track progress here:
https://issues.apache.org/jira/browse/DAEMON-401

Mark


On 30/08/2019 15:57, David Gutknecht wrote:
> Hello everybody,
> 
> I tried to update the prunsrv.exe (1.0.15) installed on my server
> (Windows 2012) to the latest version (1.2.0)
> I simply replaced the exe with the newest version.
> After replacing it I was no more able to start the service.
> Windows deliver the message "1067: the process has unexpectedly been
> stopped"
> The log-file contains only following messages:
> [2019-08-30 14:43:49] [debug] ( prunsrv.c:1754) [20592] Apache Commons
> Daemon procrun log initialized.
> [2019-08-30 14:43:49] [info]  ( prunsrv.c:1758) [20592] Apache Commons
> Daemon procrun (1.2.0.0 32-bit) started.
> [2019-08-30 14:43:49] [info]  ( prunsrv.c:1668) [20592] Running Service
> 'Med2Unify_Swisscom'...
> [2019-08-30 14:43:49] [debug] ( prunsrv.c:1441) [22040] Inside
> ServiceMain...
> [2019-08-30 14:43:49] [debug] ( prunsrv.c:904 ) [22040]
> reportServiceStatusE: dwCurrentState = 2, dwWin32ExitCode = 0,
> dwWaitHint = 3000, dwServiceSpecificExitCode = 0.
> [2019-08-30 14:43:49] [info]  ( prunsrv.c:1196) [22040] Starting service...
> 
> If I replace back the prunsrv.exe with the oldest version (1.0.15). It
> works fine.
> I use AdoptOpenJDK (Hotspot) JRE 11
> 
> This is the command Line I used to install the service:
> prunsrv.exe^
>  //US//ServiceEngine^
>  --Startup=manual^
>  --DisplayName="ServiceEngine"^
>  --Classpath=ServiceEngine.jar^
>  --Jvm="C:\Program Files (x86)\jdk-11.0.4+11-jre\bin\client\jvm.dll"^
>  --StartMode jvm^
>  --StartClass ch.novcom.ServiceEngine^
>  --StartMethod windowsService^
>  --StartParams start^
>  --StopMode jvm^
>  --StopClass ch.novcom.ServiceEngine^
>  --StopMethod windowsService^
>  --StopParams stop^
>  --LogPath "%CD%\log"^
>  --LogPrefix ServiceEngine_
>  --LogLevel Debug
> 
> 
> And below the Java source code of the object that contains the Daemon part:
> public class ServiceEngine implements Daemon {
>     private final static Logger LOGGER =
> Logger.getLogger(ServiceEngine.class.getName());
> 
>     private static TheEngine myEngine = null;
>     private static ServiceEngine m2uInstance = new ServiceEngine();
> 
>     /**
>      * The Java entry point.
>      *
>      * @param args
>      *    Command line arguments, all ignored.
>      */
>     public static void main(String[] args) {
>         LOGGER.entering("ServiceEngine", "main");
>         // the main routine is only here so I can also run the app from the
>         // command line
> 
>         m2uInstance.initialize();
> 
>         Scanner sc = new Scanner(System.in);
>         //wait until receive stop command from keyboard
>         System.out.printf("Enter 'stop' to halt: ");
>         while(!sc.nextLine().toLowerCase().equals("stop") &&
> myEngine!=null && myEngine.isAlive());
> 
>         if (myEngine!=null && myEngine.isAlive()) {
>             m2uInstance.terminate();
>         }
>         sc.close();
>         LOGGER.exiting("ServiceEngine", "main");
>     }
> 
>     /**
>      * Static methods called by prunsrv to start/stop the Windows
> service. Pass
>      * the argument "start" to start the service, and pass "stop" to
> stop the
>      * service.
>      *
>      * Taken lock, stock and barrel from Christopher Pierce's blog at
>      * http://blog.platinumsolutions.com/node/234
>      *
>      * @param args
>      *    Arguments from prunsrv command line
>      **/
>     public static void windowsService(String args[]) {
>         String cmd = "start";
>         if (args.length > 0) {
>             cmd = args[0];
>         }
> 
>         if ("start".equals(cmd)) {
>             m2uInstance.windowsStart();
>         } else {
>             m2uInstance.windowsStop();
>         }
>     }
> 
>     public void windowsStart() {
>         LOGGER.entering(getClass().getName(), "windowsStart");
> 
>         initialize();
>         if (myEngine != null){
>             while (myEngine.isAlive()) {
>                 // don't return until stopped
>                 synchronized (this) {
>                     try {
>                         this.wait(5000); // wait 5s and check if stopped
>                     } catch (InterruptedException ie) {
>                     }
>                 }
>             }
>         }
> 
>         LOGGER.exiting(getClass().getName(), "windowsStart");
>     }
> 
>     public void windowsStop() {
>         LOGGER.entering(getClass().getName(), "windowsStop");
>         terminate();
>         synchronized (this) {
>             // stop the start loop
>             this.notify();
>         }
>         LOGGER.exiting(getClass().getName(), "windowsStop");
>     }
> 
>     // Implementing the Daemon interface is not required for Windows but
> is for
>     // Linux
>     @Override
>     public void init(DaemonContext arg0) throws Exception {
>         LOGGER.entering(getClass().getName(), "init");
> 
>         L

Re: [daemon] Enabling Native Memory Tracking while starting tomcat using jsvc

2019-07-30 Thread Mark Thomas
On 30/07/2019 11:18, కృష్ణ చైతన్య wrote:
> Hi,
> 
> We are trying to enable Native Memory Tracking by setting the flags 
> "-XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=detail 
> -XX:+PrintNMTStatistics" during startup.  We use jsvc to fire up tomcat and 
> it fails to turn on Native Memory Tracking.  In Catalina.out we see the 
> following error during startup.
> 
> Java HotSpot(TM) 64-Bit Server VM warning: Native Memory Tracking did not 
> setup properly, using wrong launcher? 
> Java HotSpot(TM) 64-Bit Server VM warning: PrintNMTStatistics is disabled, 
> because native memory tracking is not enabled
> 
> The below link from the tomcat users mailer list, indicates that we can’t 
> enable Native Memory Tracking while using jsvc.  Is there a way to have this 
> turned on while using jsvc to start tomcat.

That would require code changes to the jsvc code to configure the
environment variable as described in:
https://blogs.oracle.com/poonam/using-nmt-with-custom-jvm-launcher

Mark

> 
> http://mail-archives.apache.org/mod_mbox/tomcat-users/201703.mbox/%3ccap-jj3o-nzo3rgkqzvhbf8zxbngwrcdmem9wawoxnkd5isb...@mail.gmail.com%3e
>  
> 
> 
> Regards,
> Krishna Chaitanya.
> 


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



Re: [Daemon] StdOut and StdErr use extra newline

2018-03-23 Thread Gil Baruch
Maybe I was misunderstood, each line ends with two newlines not just the
end of the file...

So there's a gap of one empty line between every two lines...

Thanks
GBa.

On Thu, Mar 22, 2018, 23:32 Gil Baruch  wrote:

> I'm using the daemon to wrap my Jetty based service. I've redirected
> stdout and stderr to the Daemon via the relevant configuration params.
>
> However, both files end up with 2 newline characters (/r/n/r/n) which
> results in a very unreadable log... especially when dealing with
> stacktraces...
>
> Any idea what could cause that?
>
> BTW, when using Jetty without the wrapper, Jetty's stdout and err do not
> suffer from this behavior.
>
> thanks,
> GBa.
>


Re: [daemon] - High memory consumption

2018-03-19 Thread Mark Thomas
On 19/03/18 08:32, Kenneth Vindum wrote:
> Dear user list
> 
> I'm having a bit of trouble with memory consumption using procsrv.exe.
> I've set the --JvmMX=4096 but the .exe process is consuming nearly 7GB of 
> memory despite the fact that the JVM only consumed the requested 4GM. The 
> remaining 3GB seems to be consumed by procsrv.exe
> 
> I can see in VisualVM that the JVM has registered the -Xmx4096m argument and 
> are using the expected 4GB. But what can be causing the procsrv.exe to be 
> using additionally 3GB? Any help will be appreciated.

The 4GB is just the Java object heap. The Java process also needs to
allocate memory for:
- Permanent Space
- Code Generation
- Socket Buffers
- Thread stacks
- Direct Memory Space
- JNI Code
- Garbage Collection
- JNI Allocated Memory

How much memory will be required for all of the above is highly
application dependent.

Mark

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



Re: [daemon] Problem with Working Directory

2018-03-07 Thread Gil Baruch
OMG, was looking for it for so long... no idea how I missed it, I went over
this page at least 5 times...

thanks a lot, worked flawlessly!
GBa.



On Wed, Mar 7, 2018 at 6:34 AM, Gary Gregory  wrote:

> Have you tried using --StartPath? See
> https://commons.apache.org/proper/commons-daemon/procrun.html
>
> Gary
>
> On Tue, Mar 6, 2018 at 2:07 PM, Gil Baruch 
> wrote:
>
> > Seems like I hit a well known issue although I couldn't find
> documentation
> > about it in the FAQ (unfortunately).
> >
> > It seems that Java does not fully support changing the working directory
> > (AKA system property 'user.dir').
> >
> > Some functionality, such as new File(relativePath) will not be affected
> by
> > a change of 'user.dir' system property and instead, the file path would
> be
> > constructed out of the actual working directory that the JVM started
> from.
> >
> > However, when using the Daemon, I cannot specify the directory from where
> > to perform the execution of the JVM...
> >
> > what am I missing?
> >
> > thanks,
> > GBa.
> >
>


Re: [daemon] Problem with Working Directory

2018-03-06 Thread Gary Gregory
Have you tried using --StartPath? See
https://commons.apache.org/proper/commons-daemon/procrun.html

Gary

On Tue, Mar 6, 2018 at 2:07 PM, Gil Baruch  wrote:

> Seems like I hit a well known issue although I couldn't find documentation
> about it in the FAQ (unfortunately).
>
> It seems that Java does not fully support changing the working directory
> (AKA system property 'user.dir').
>
> Some functionality, such as new File(relativePath) will not be affected by
> a change of 'user.dir' system property and instead, the file path would be
> constructed out of the actual working directory that the JVM started from.
>
> However, when using the Daemon, I cannot specify the directory from where
> to perform the execution of the JVM...
>
> what am I missing?
>
> thanks,
> GBa.
>


Re: [daemon] Can init() be called more than once in a single JVM session?

2017-11-29 Thread Mark Thomas
On 29/11/17 11:09, Andrea Lo Pumo wrote:
> Does anyone have an answer?

My expectation is that init() will be call once per JVM but that the
jsvc process may create multiple JVMs (sequentially, not concurrently)
and that init() will be called for each.

If jsvc detects that the JVM has aborted (OOME, crash, etc.) it uses
exit code 123 to signal a restart. You can call System.exit(123); to
achieve the same result.

Any other clean exit will be treated as a normal shutdown and there will
be no restart.

HTH,

Mark


> 
> Best regards.
> 
> 2017-10-23 15:53 GMT+02:00 Andrea Lo Pumo :
> 
>> Since now, I have always assumed that init() is called once, and no
>> more. Now I am not sure anymore. My doubt is that init() can be called
>> a second time, after destroy() has been called, for example, if the
>> program is restarted by Jsvc. Is this so? If yes, I should use a
>> static variable "alreadyInitialized" and do nothing in init() if it is
>> true, at least for things that have not to be done more than once.
>>
>> A second question: when does Jsvc restart the program exactly? If I
>> kill the program, or use -stop. It simply stop()s and destroy()s and
>> exits. I have been able to simulate a restart using System.exit(123).
>> Are there other cases when Jsvc restarts the program?
>>
> 


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



Re: [daemon] Can init() be called more than once in a single JVM session?

2017-11-29 Thread Andrea Lo Pumo
Does anyone have an answer?

Best regards.

2017-10-23 15:53 GMT+02:00 Andrea Lo Pumo :

> Since now, I have always assumed that init() is called once, and no
> more. Now I am not sure anymore. My doubt is that init() can be called
> a second time, after destroy() has been called, for example, if the
> program is restarted by Jsvc. Is this so? If yes, I should use a
> static variable "alreadyInitialized" and do nothing in init() if it is
> true, at least for things that have not to be done more than once.
>
> A second question: when does Jsvc restart the program exactly? If I
> kill the program, or use -stop. It simply stop()s and destroy()s and
> exits. I have been able to simulate a restart using System.exit(123).
> Are there other cases when Jsvc restarts the program?
>


Re: [daemon]

2017-05-22 Thread Ian Emmons

On 2017-05-18 17:50, Vadym Slavov wrote:

Hello,

I have a question regarding jsvc daemon:

I have installed successfully the server apache-tomcat-9.0.0.M11 on my
«macOS Sierra» and It works, I can start and stop it.
I also installed your jsvc daemon and tried to start the tomcat server
as suggested in http://tomcat.apache.org/tomcat-9.0-doc/setup.html
with it but unfortunately I get error messages. It doesn’t find
neither VM nor JVM library file although the $JAVA_HOME path is
correct.

I have libraries in
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/../MacOS/libjli.dylib
but not how required in
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/../Libraries/libserver.dylib
Can you please help if I am wrong or there is a bug in jsvc?

I send you my run-script and error-messages.


Best regards,

Vadym Slavov


Vadym,

The current binaries for [daemon] are version 1.0.15, which is quite 
old.  They contain a bug [1] that prevents jsvc from finding the correct 
JVM on MacOS.  I submitted a patch for this some time ago, and I believe 
that it has been merged into the code base.  However, new binaries have 
not been released since then.  If you download the latest source and 
build it yourself, it should work with Java 8.


Cheers,

Ian Emmons

[1] https://issues.apache.org/jira/browse/DAEMON-281

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



Re: [daemon]

2017-05-19 Thread Benedikt Ritter
Hello Vadym,

> Am 18.05.2017 um 17:50 schrieb Vadym Slavov :
> 
> Hello,
> 
> I have a question regarding jsvc daemon:
> 
> I have installed successfully the server apache-tomcat-9.0.0.M11 on my «macOS 
> Sierra» and It works, I can start and stop it.
> I also installed your jsvc daemon and tried to start the tomcat server as 
> suggested in http://tomcat.apache.org/tomcat-9.0-doc/setup.html with it but 
> unfortunately I get error messages. It doesn’t find neither VM nor JVM 
> library file although the $JAVA_HOME path is correct. 
> 
> I have libraries in 
> /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/../MacOS/libjli.dylib
> but not how required in 
> /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/../Libraries/libserver.dylib
> Can you please help if I am wrong or there is a bug in jsvc?
> 
> I send you my run-script and error-messages.  

This mailing list does not accept file attachments. Can you please provide the 
relevant files for example via pastbin?

Thank you!
Benedikt

> 
> 
> Best regards,
> 
> Vadym Slavov
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org


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



Re: [daemon] [windows] JVM exit codes in jvm mode

2016-06-17 Thread Benedikt Ritter
Hello Thomas,

I can't help you right away, but maybe Mark Thomas (in cc) can help since
AFAIK Tomcat uses daemon as well.

Regards,
Benedikt

Thomas Kappler  schrieb am Di., 14. Juni 2016 um
21:37 Uhr:

> Hi!
>
> We run a Java application with procrun on Windows Server 2012. The JVM
> is configured with -XX:+ExitOnOutOfMemoryError. As the patch for this
> flag shows, the exit code on OOM is 3.
>
> When I run our application in procrun's "java" mode, i.e., as a
> separate process, I see that procrun receives the exit code 3 when
> Java exits. The debug log shows
>
> [2016-05-25 03:25:50] [debug] ( prunsrv.c:1563) [ 1964] JVM destroyed.
> [2016-05-25 03:25:50] [debug] ( prunsrv.c:844 ) [ 1964]
> reportServiceStatusE: 1, 1066, 0, 3
>
> However, when I run it in-process using the "jvm" mode, procrun thinks
> the exit code is 0.
>
> [2016-05-24 17:17:21] [debug] ( prunsrv.c:920 ) [ 4332] VM exit code: 0
> [2016-05-24 17:17:21] [debug] ( prunsrv.c:844 ) [ 4332]
> reportServiceStatusE: 1, 0, 0, 0
>
> This screws up the automatic recovery action on failure that is
> configured for the Windows service. An exit code of 0 looks like a
> clean shutdown, not a failure.
>
> We might migrate to the Java mode, but for various reasons I'd prefer
> not to. Is there a way to get the exit code in jvm mode?
>
> Thanks,
> Thomas
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


Re: [daemon] When to use MyClass implements Daemon

2015-09-23 Thread John Febarro
I found the answer after some luck with searching around the wiki.

>From "Combined java class for Windows and Linux" found in ( 
>https://wiki.apache.org/commons/Daemon ) it states:

// Implementing the Daemon interface is not required for Windows but is 
for Linux

Another example is how Apache Tomcat uses commons-daemon and omits the Daemon 
interface.   Since the project documentation is a bit out of date hopefully 
this is a useful reference for others.


> Sent: Tuesday, September 22, 2015 at 4:34 PM
> From: "John Febarro" 
> To: user@commons.apache.org
> Subject: [daemon] When to use MyClass implements Daemon
>
> I read the Wiki and looked at the examples in src/samples/ but it wasn't 
> clear on when I would use a line like:
> 
> public class MyClass implements Daemon
> 
> or just  public class MyClass   (without the implements portion).
> 
> 
> Is there any logic or reasons for when to use the implements Daemon and when 
> not to?   Any significant difference?
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 
> 

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



Re: [daemon] How to daemonize a Java app that has a private default constructor

2015-08-08 Thread Bill Durant
On Aug 8, 2015, at 9:29 AM, sebb  wrote:
> 
> On 28 July 2015 at 00:56, Bill Durant  wrote:
>> Greetings:
>> 
>> I have Java application that has a private default constructor in order to
>> support the singleton pattern.
>> 
>> When I try to daemonize the application with jsvc, I get the following
>> exception:
>> 
>> java.lang.IllegalAccessException: Class
>> org.apache.commons.daemon.support.DaemonLoader can not access a member of
>> class example.App with modifiers "private"
>>at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:101)
>>at java.lang.Class.newInstance(Class.java:432)
>>at
>> org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
>> Cannot load daemon
>> Service exit with a return value of 3
>> 
>> Is it not possible to daemonize a Java application that has a private
>> default constructor with jsvc?
> 
> I would try writing a wrapper (with a public constructor) that creates
> the singleton.

Yes, that’s what I ended up doing in the end.  Thanks!  -Bill

> 
>> Thanks!
>> 
>> Bill
>> 
>> 
>> 
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 


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



Re: [daemon] How to daemonize a Java app that has a private default constructor

2015-08-08 Thread sebb
On 28 July 2015 at 00:56, Bill Durant  wrote:
> Greetings:
>
> I have Java application that has a private default constructor in order to
> support the singleton pattern.
>
> When I try to daemonize the application with jsvc, I get the following
> exception:
>
> java.lang.IllegalAccessException: Class
> org.apache.commons.daemon.support.DaemonLoader can not access a member of
> class example.App with modifiers "private"
> at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:101)
> at java.lang.Class.newInstance(Class.java:432)
> at
> org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
> Cannot load daemon
> Service exit with a return value of 3
>
> Is it not possible to daemonize a Java application that has a private
> default constructor with jsvc?

I would try writing a wrapper (with a public constructor) that creates
the singleton.

> Thanks!
>
> Bill
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [daemon] Problem using procrun for Java service

2015-01-28 Thread Bernd Eckenfels
Hm,

you can try the following:

a) specify the JVM directly, maybe the auto does not work outside a
user session.
b) try tu use the prunmsgr to edit the settings instead of the command
line
c) turn on logging and check the logfile

Is the S:\ drive a share? can you try with a local disk as well?
(permission)

What is the user you use to start the service? try to enter a user
account (do this in the service manager so the user gets the required
permission).

Gruss
Bernd


Am Wed, 28 Jan 2015 10:31:58 -0500
schrieb "Wong, Nancy" :

> I have installed my java application as a Windows service using
> following:
> 
> prunsrv.exe //IS//SG_FileSync --Install="S:\Automation\prunsrv.exe"
> --Jvm=auto --Startup=auto --StartMode jvm
> --Classpath="S:\Automation\SG_FileSync.jar" --StartClass=SyncFile
> --StartMethod=main
> 
> I can run the program successfully in console mode:
> 
> prunsrv.exe //TS//SG_FileSync
> 
> But I cannot start the service directly in Windows, or using
> prunsrv.exe //ES//SG_FileSync or via prunmgr.  I get the following
> error message:
> 
> The system cannot find the file specified.  Failed to start service.
> 
> What am I able to run my application in console mode but not using ES?
> 
> Thanks,
> Nancy
> 
> 
> 
> 
> The information contained in this message is intended only for the
> recipient, and may be a confidential attorney-client communication or
> may otherwise be privileged and confidential and protected from
> disclosure. If the reader of this message is not the intended
> recipient, or an employee or agent responsible for delivering this
> message to the intended recipient, please be aware that any
> dissemination or copying of this communication is strictly
> prohibited. If you have received this communication in error, please
> immediately notify us by replying to the message and deleting it from
> your computer. McGraw Hill Financial reserves the right, subject to
> applicable local law, to monitor, review and process the content of
> any electronic message or information sent to or from McGraw Hill
> Financial e-mail addresses without informing the sender or recipient
> of the message. By sending electronic message or information to
> McGraw Hill Financial e-mail addresses you, as the sender, are
> consenting to McGraw Hill Financial processing any of your personal
> data therein.
> 


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



Re: [daemon] Unable to read tomcat.pid file created by Tomcat process

2014-11-16 Thread Ian Emmons
> On Nov 11, 2014, at 7:44 PM, Bernd Eckenfels  wrote:
> 
> Am Tue, 11 Nov 2014 00:09:57 -0500 schrieb Anil Ambati :
>> Why does the Tomcat server keep the PID file locked, preventing other 
>> processes to even read the file? Is there a work around or solution for this 
>> problem?
> 
> I think the reason for that is, that you can this way detect if the process 
> is still running: if it is locked, then it is running.

Assuming that the pid file is created in the native code of procrun, then this 
could be solved by using the fine-grained sharing options of the Win32 API 
CreateFile (which is used to both create and open files).  Specifically, 
procrun could call CreateFile so as to open the file in a mode where other 
processes can read the file but not write to it by passing FILE_SHARE_READ for 
the dwShareMode parameter.

This would allow other processes to read the file by opening for read-only 
access, and it would also allow another process to test if the procrun process 
is still running by opening with write access.

> Of course this makes it hard to read the file. To work around this I guess a 
> native library is needed. (Or you execute "cmd /C type file.pid"). Not sure 
> if any component offers this (might be a good addition to commons-daemon).

I don’t think a native library or cmd’s type command will help here -- if the 
OS is enforcing exclusive access to the file, then that restriction will apply 
to all other processes.

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



Re: [daemon] Unable to read tomcat.pid file created by Tomcat process

2014-11-11 Thread Bernd Eckenfels
Am Tue, 11 Nov 2014 00:09:57 -0500
schrieb Anil Ambati :
> Why does the Tomcat server keep the PID file locked, preventing other 
> processes to even read the file? Is there a work around or solution
> for this problem?

I think the reason for that is, that you can this way detect if the
process is still running: if it is locked, then it is running.

Of course this makes it hard to read the file. To work around this I
guess a native library is needed. (Or you execute "cmd /C type
file.pid"). Not sure if any component offers this (might be a good
addition to commons-daemon).

Gruss
Bernd

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



Re: [daemon] Unable to read tomcat.pid file created by Tomcat process

2014-11-11 Thread Mark Thomas
On 11/11/2014 16:47, Gary Gregory wrote:
> Sorry, I meant what version of Commons Daemon.

It is the latest release. 1.0.15.

Mark

> 
> Gary
> 
> On Tue, Nov 11, 2014 at 11:37 AM, Anil Ambati  wrote:
> 
>> I am using Apache Tomcat 7.0.56. I think that is the latest.
>>
>> Regards,
>>   --
>>   *Anilkumar Ambati*  4205 S Miami Blvd
>>  WebSphere Virtual Enterprise Development  Durham, 27703-9141 Phone:
>> +1-919-254-6152  USA Mobile: +1-919-434-5674e-mail: aamb...@us.ibm.com
>>
>> --
>> "You have no responsibility to live up to what other people think you
>> ought to accomplish." -Richard Feynman (1918-1988)
>>
>>
>>
>>  From: Gary Gregory  To: Commons Users List <
>> user@commons.apache.org>,  Date: 11/11/2014 10:18 AM Subject: Re:
>> [daemon] Unable to read tomcat.pid file created by Tomcat process
>> --
>>
>>
>>
>> So which version of [daemon] are you using? Can you try the latest and
>> greatest. It might not matter but it'll make debugging easier for anyone on
>> this ML.
>>
>> Gary
>>
>> On Tue, Nov 11, 2014 at 10:06 AM, Anil Ambati  wrote:
>>
>>> I was asked to post this question in this forum.
>>>
>>> We have a requirement to read the PID file created by the Tomcat server
>>> process on Windows, but we are not able to using RandomAccessFile or
>>> FileInputStream because the file seems to be
>>> locked by the Tomcat process.
>>>
>>> Why does the Tomcat server keep the PID file locked, preventing other
>>> processes to even read the file? Is there a work around or solution for
>>> this problem?
>>>
>>>
>>> Christopher Schultz wrote this in Tomcat user forum:
>>> 
>>> I took a quick look, and it looks like the PID file is being created
>>> with a file option FILE_FLAG_DELETE_ON_CLOSE which causes the OS to
>>> delete the file off the disk when all file handles are closed. So,
>>> closing the file handle will result in the PID file being deleted.
>>>
>>> This option was added because the PID file wasn't being removed if the
>>> service crashed, which kept the service from restarting (oops).
>>>
>>> https://issues.apache.org/jira/browse/DAEMON-183
>>>
>>> It seems like an option to control what happens on startup when the
>>> PID file already exists would be a good idea. You'll have to ask the
>>> procrun folks about what the options are. It seems reasonable to be
>>> able to read the PID file, since not being able to read it makes it
>>> kind of useless other than as a lock-file (i.e. its contents are
>>> irrelevant).
>>>
>>>
>>> Regards,
>>>   --
>>>   *Anilkumar Ambati*  4205 S Miami Blvd
>>>  WebSphere Virtual Enterprise Development  Durham, 27703-9141 Phone:
>>> +1-919-254-6152  USA Mobile: +1-919-434-5674e-mail:
>> aamb...@us.ibm.com
>>>
>>> --
>>> "You have no responsibility to live up to what other people think you
>>> ought to accomplish." -Richard Feynman (1918-1988)
>>>
>>
>>
>>
>> --
>> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>
>>
> 
> 


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



Re: [daemon] Unable to read tomcat.pid file created by Tomcat process

2014-11-11 Thread Gary Gregory
Sorry, I meant what version of Commons Daemon.

Gary

On Tue, Nov 11, 2014 at 11:37 AM, Anil Ambati  wrote:

> I am using Apache Tomcat 7.0.56. I think that is the latest.
>
> Regards,
>   --
>   *Anilkumar Ambati*  4205 S Miami Blvd
>  WebSphere Virtual Enterprise Development  Durham, 27703-9141 Phone:
> +1-919-254-6152  USA Mobile: +1-919-434-5674e-mail: aamb...@us.ibm.com
>
> --
> "You have no responsibility to live up to what other people think you
> ought to accomplish." -Richard Feynman (1918-1988)
>
>
>
>  From: Gary Gregory  To: Commons Users List <
> user@commons.apache.org>,  Date: 11/11/2014 10:18 AM Subject: Re:
> [daemon] Unable to read tomcat.pid file created by Tomcat process
> --
>
>
>
> So which version of [daemon] are you using? Can you try the latest and
> greatest. It might not matter but it'll make debugging easier for anyone on
> this ML.
>
> Gary
>
> On Tue, Nov 11, 2014 at 10:06 AM, Anil Ambati  wrote:
>
> > I was asked to post this question in this forum.
> >
> > We have a requirement to read the PID file created by the Tomcat server
> > process on Windows, but we are not able to using RandomAccessFile or
> > FileInputStream because the file seems to be
> > locked by the Tomcat process.
> >
> > Why does the Tomcat server keep the PID file locked, preventing other
> > processes to even read the file? Is there a work around or solution for
> > this problem?
> >
> >
> > Christopher Schultz wrote this in Tomcat user forum:
> > 
> > I took a quick look, and it looks like the PID file is being created
> > with a file option FILE_FLAG_DELETE_ON_CLOSE which causes the OS to
> > delete the file off the disk when all file handles are closed. So,
> > closing the file handle will result in the PID file being deleted.
> >
> > This option was added because the PID file wasn't being removed if the
> > service crashed, which kept the service from restarting (oops).
> >
> > https://issues.apache.org/jira/browse/DAEMON-183
> >
> > It seems like an option to control what happens on startup when the
> > PID file already exists would be a good idea. You'll have to ask the
> > procrun folks about what the options are. It seems reasonable to be
> > able to read the PID file, since not being able to read it makes it
> > kind of useless other than as a lock-file (i.e. its contents are
> > irrelevant).
> >
> >
> > Regards,
> >   --
> >   *Anilkumar Ambati*  4205 S Miami Blvd
> >  WebSphere Virtual Enterprise Development  Durham, 27703-9141 Phone:
> > +1-919-254-6152  USA Mobile: +1-919-434-5674e-mail:
> aamb...@us.ibm.com
> >
> > --
> > "You have no responsibility to live up to what other people think you
> > ought to accomplish." -Richard Feynman (1918-1988)
> >
>
>
>
> --
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>


-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


Re: [daemon] Unable to read tomcat.pid file created by Tomcat process

2014-11-11 Thread Anil Ambati
I am using Apache Tomcat 7.0.56. I think that is the latest.

Regards,



Anilkumar Ambati
 4205 S Miami Blvd

WebSphere Virtual Enterprise Development
 Durham, 27703-9141
Phone:
+1-919-254-6152
 USA
Mobile:
+1-919-434-5674
 

e-mail:
aamb...@us.ibm.com
 

"You have no responsibility to live up to what other people think you 
ought to accomplish." -Richard Feynman (1918-1988)
 
 




From:
Gary Gregory 
To:
Commons Users List , 
Date:
11/11/2014 10:18 AM
Subject:
Re: [daemon] Unable to read tomcat.pid file created by Tomcat process



So which version of [daemon] are you using? Can you try the latest and
greatest. It might not matter but it'll make debugging easier for anyone 
on
this ML.

Gary

On Tue, Nov 11, 2014 at 10:06 AM, Anil Ambati  wrote:

> I was asked to post this question in this forum.
>
> We have a requirement to read the PID file created by the Tomcat server
> process on Windows, but we are not able to using RandomAccessFile or
> FileInputStream because the file seems to be
> locked by the Tomcat process.
>
> Why does the Tomcat server keep the PID file locked, preventing other
> processes to even read the file? Is there a work around or solution for
> this problem?
>
>
> Christopher Schultz wrote this in Tomcat user forum:
> 
> I took a quick look, and it looks like the PID file is being created
> with a file option FILE_FLAG_DELETE_ON_CLOSE which causes the OS to
> delete the file off the disk when all file handles are closed. So,
> closing the file handle will result in the PID file being deleted.
>
> This option was added because the PID file wasn't being removed if the
> service crashed, which kept the service from restarting (oops).
>
> https://issues.apache.org/jira/browse/DAEMON-183
>
> It seems like an option to control what happens on startup when the
> PID file already exists would be a good idea. You'll have to ask the
> procrun folks about what the options are. It seems reasonable to be
> able to read the PID file, since not being able to read it makes it
> kind of useless other than as a lock-file (i.e. its contents are
> irrelevant).
>
>
> Regards,
>   --
>   *Anilkumar Ambati*  4205 S Miami Blvd
>  WebSphere Virtual Enterprise Development  Durham, 27703-9141 Phone:
> +1-919-254-6152  USA Mobile: +1-919-434-5674e-mail: 
aamb...@us.ibm.com
>
> --
> "You have no responsibility to live up to what other people think you
> ought to accomplish." -Richard Feynman (1918-1988)
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory




Re: [daemon] Unable to read tomcat.pid file created by Tomcat process

2014-11-11 Thread Gary Gregory
So which version of [daemon] are you using? Can you try the latest and
greatest. It might not matter but it'll make debugging easier for anyone on
this ML.

Gary

On Tue, Nov 11, 2014 at 10:06 AM, Anil Ambati  wrote:

> I was asked to post this question in this forum.
>
> We have a requirement to read the PID file created by the Tomcat server
> process on Windows, but we are not able to using RandomAccessFile or
> FileInputStream because the file seems to be
> locked by the Tomcat process.
>
> Why does the Tomcat server keep the PID file locked, preventing other
> processes to even read the file? Is there a work around or solution for
> this problem?
>
>
> Christopher Schultz wrote this in Tomcat user forum:
> 
> I took a quick look, and it looks like the PID file is being created
> with a file option FILE_FLAG_DELETE_ON_CLOSE which causes the OS to
> delete the file off the disk when all file handles are closed. So,
> closing the file handle will result in the PID file being deleted.
>
> This option was added because the PID file wasn't being removed if the
> service crashed, which kept the service from restarting (oops).
>
> https://issues.apache.org/jira/browse/DAEMON-183
>
> It seems like an option to control what happens on startup when the
> PID file already exists would be a good idea. You'll have to ask the
> procrun folks about what the options are. It seems reasonable to be
> able to read the PID file, since not being able to read it makes it
> kind of useless other than as a lock-file (i.e. its contents are
> irrelevant).
>
>
> Regards,
>   --
>   *Anilkumar Ambati*  4205 S Miami Blvd
>  WebSphere Virtual Enterprise Development  Durham, 27703-9141 Phone:
> +1-919-254-6152  USA Mobile: +1-919-434-5674e-mail: aamb...@us.ibm.com
>
> --
> "You have no responsibility to live up to what other people think you
> ought to accomplish." -Richard Feynman (1918-1988)
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition

JUnit in Action, Second Edition 
Spring Batch in Action 
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


Re: [daemon] Unable to read tomcat.pid file created by Tomcat process

2014-11-11 Thread Gary Gregory
Wrong list. You probably want
https://tomcat.apache.org/lists.html#tomcat-users

Gary

On Tue, Nov 11, 2014 at 10:06 AM, Anil Ambati  wrote:

> I was asked to post this question in this forum.
>
> We have a requirement to read the PID file created by the Tomcat server
> process on Windows, but we are not able to using RandomAccessFile or
> FileInputStream because the file seems to be
> locked by the Tomcat process.
>
> Why does the Tomcat server keep the PID file locked, preventing other
> processes to even read the file? Is there a work around or solution for
> this problem?
>
>
> Christopher Schultz wrote this in Tomcat user forum:
> 
> I took a quick look, and it looks like the PID file is being created
> with a file option FILE_FLAG_DELETE_ON_CLOSE which causes the OS to
> delete the file off the disk when all file handles are closed. So,
> closing the file handle will result in the PID file being deleted.
>
> This option was added because the PID file wasn't being removed if the
> service crashed, which kept the service from restarting (oops).
>
> https://issues.apache.org/jira/browse/DAEMON-183
>
> It seems like an option to control what happens on startup when the
> PID file already exists would be a good idea. You'll have to ask the
> procrun folks about what the options are. It seems reasonable to be
> able to read the PID file, since not being able to read it makes it
> kind of useless other than as a lock-file (i.e. its contents are
> irrelevant).
>
>
> Regards,
>   --
>   *Anilkumar Ambati*  4205 S Miami Blvd
>  WebSphere Virtual Enterprise Development  Durham, 27703-9141 Phone:
> +1-919-254-6152  USA Mobile: +1-919-434-5674e-mail: aamb...@us.ibm.com
>
> --
> "You have no responsibility to live up to what other people think you
> ought to accomplish." -Richard Feynman (1918-1988)
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition

JUnit in Action, Second Edition 
Spring Batch in Action 
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


Re: [daemon] Unable to read tomcat.pid file created by Tomcat process

2014-11-11 Thread Gary Gregory
Oops, sorry, please ignore my previous message.

On Tue, Nov 11, 2014 at 10:11 AM, Gary Gregory 
wrote:

> Wrong list. You probably want
> https://tomcat.apache.org/lists.html#tomcat-users
>
> Gary
>
> On Tue, Nov 11, 2014 at 10:06 AM, Anil Ambati  wrote:
>
>> I was asked to post this question in this forum.
>>
>> We have a requirement to read the PID file created by the Tomcat server
>> process on Windows, but we are not able to using RandomAccessFile or
>> FileInputStream because the file seems to be
>> locked by the Tomcat process.
>>
>> Why does the Tomcat server keep the PID file locked, preventing other
>> processes to even read the file? Is there a work around or solution for
>> this problem?
>>
>>
>> Christopher Schultz wrote this in Tomcat user forum:
>> 
>> I took a quick look, and it looks like the PID file is being created
>> with a file option FILE_FLAG_DELETE_ON_CLOSE which causes the OS to
>> delete the file off the disk when all file handles are closed. So,
>> closing the file handle will result in the PID file being deleted.
>>
>> This option was added because the PID file wasn't being removed if the
>> service crashed, which kept the service from restarting (oops).
>>
>> https://issues.apache.org/jira/browse/DAEMON-183
>>
>> It seems like an option to control what happens on startup when the
>> PID file already exists would be a good idea. You'll have to ask the
>> procrun folks about what the options are. It seems reasonable to be
>> able to read the PID file, since not being able to read it makes it
>> kind of useless other than as a lock-file (i.e. its contents are
>> irrelevant).
>>
>>
>> Regards,
>>   --
>>   *Anilkumar Ambati*  4205 S Miami Blvd
>>  WebSphere Virtual Enterprise Development  Durham, 27703-9141 Phone:
>> +1-919-254-6152  USA Mobile: +1-919-434-5674e-mail:
>> aamb...@us.ibm.com
>> --
>> "You have no responsibility to live up to what other people think you
>> ought to accomplish." -Richard Feynman (1918-1988)
>>
>
>
>
> --
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> Java Persistence with Hibernate, Second Edition
> 
> JUnit in Action, Second Edition 
> Spring Batch in Action 
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition

JUnit in Action, Second Edition 
Spring Batch in Action 
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


RE: [daemon]

2014-07-30 Thread Jérôme Serré
If interested someone.

windows can’t manage services on network location like :
“Z:\Jerome\SoftWare\Divers……

Now I moved files on c:\ and it’s ok.

 

 

 

De : Jérôme Serré [mailto:jerome.michel.se...@gmail.com] 
Envoyé : mardi 29 juillet 2014 10:04
À : user@commons.apache.org
Objet : [daemon]

 

Hello,

 

Sorry if I’m posting in a wrong way but it’s difficult to search in
thousands messages from the archive.

I want to use prunserv (Commons Daemon procrun (1.0.15.0 64-bit)) like a
windows 7 x64 service with simple java class but it doesn’t work as I want.

 

1.Registration of prunser is ok

2.Inst service is ok

3.Running service in prunserv console is ok

4.Running service in service windows console is NOT ok

I get this error : service doesn’t start. File not found.

 

CMD =

 

TestService //IS//TestService --DisplayName="Test Service"
--Install="Z:\Jerome\SoftWare\Divers\Developpement\java\test\TestService.exe
" --Jvm="C:\Program Files\Java\jre7\bin\server\jvm.dll" --StartMode=jvm
--StartClass=Main --StopMode=jvm --StopClass=Main --JavaHome="C:\Program
Files\Java\jre7" --StartMethod=start --StopMethod=stop --StdError=auto
--LogPath="Z:\Jerome\SoftWare\Divers\Developpement\java\test\logs"

TestService start

 

Thank you for your help.

 

Best regards

Jérôme Serré

 



RE: [daemon]

2014-07-17 Thread Martin Gainty
i assume this is not a permissions issue

does your main class implement org.apache.commons.daemon.Daemon?

does your main class override init method?
@Override
public void init(DaemonContext dc) throws DaemonInitException, Exception 

does your main class override start method?
@Override
public void start() throws Exception 
does your classpath contain commons-daemon AND your jar e.g.
CLASSPATH="/usr/share/java/commons-daemon.jar":"/path/to/your.jar"

did you run jsvc.exe with -home parameter and -cp param e.g.

jsvc -home "$JAVA_HOME -cp $CLASSPATH mypackage.myClass ?

http://stackoverflow.com/questions/7687159/how-to-convert-a-java-program-to-daemon-with-jsvc

?
Martin 


> From: andrew.mar...@exactearth.com
> To: user@commons.apache.org
> Subject: RE: [daemon]
> Date: Thu, 17 Jul 2014 17:21:57 +
> 
> Hi Martin,
> 
> PATH= 
> /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/apache-maven-3.1.1/bin:/root/bin
> 
> I don't have JAVA_HOME set as an environment variable but I pass it into 
> jsvc:  /usr/lib/jvm/java-1.7.0
> 
> CLASSPATH: The  full pathname to my main jar. The manifest inside the jar has 
> the rest of the dependencies, including commons-daemon. I know this is fine, 
> because if I just run the jar using java -jar, it works. I also know that it 
> is being passed correctly to jsvc, because when I remove it I get a more 
> fundamental error.
> 
> Best,
> Andrew
> 
> -Original Message-
> From: Martin Gainty [mailto:mgai...@hotmail.com]
> Sent: July-17-14 1:03 PM
> To: Commons Users List
> Subject: RE: [daemon]
> 
> can you display PATH, CLASSPATH and JAVA_HOME please
> assume:
> PATH folder = folders for all executables?
> CLASSPATH folders = contains all classes referenced by main java 
> class..including local folder e.g. $CLASSPATH = .:$CLASSPATH ?
> files that are read are in SAME directory where you executed jsvc.exe ?
> JAVA_HOME is set to base folder of JAVA installation ?
> 
> what happens when you run the same class using java.exe mypackage.MyClass ?
> 
> Martin
> ___
> 
> 
> > From: andrew.mar...@exactearth.com
> > To: user@commons.apache.org
> > Subject: RE: [daemon]
> > Date: Thu, 17 Jul 2014 16:42:51 +
> >
> > The output is identical to what I sent in the last email:
> >
> > java.lang.InstantiationException: mypackage.MyClass
> > at java.lang.Class.newInstance(Class.java:359)
> > at 
> > org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
> > 17/07/2014 17:39:24 10600 jsvc.exec error: Cannot load daemon
> > 17/07/2014 17:39:24 10599 jsvc.exec error: Service exit with a return value 
> > of 3
> >
> > This is from the error file. Nothing in the stdout file.
> >
> > Andrew
> >
> > -Original Message-
> > From: Martin Gainty [mailto:mgai...@hotmail.com]
> > Sent: July-17-14 12:37 PM
> > To: Commons Users List
> > Subject: RE: [daemon]
> >
> > jsvc.exe -outfile stdout.out -errfile stderr.errcat stdout.out cat 
> > stderr.err
> >
> > report back the results
> > Martin
> >
> > From: andrew.mar...@exactearth.com
> > To: user@commons.apache.org
> > Subject: [daemon]
> > Date: Thu, 17 Jul 2014 16:24:14 +
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Hi,
> >
> > I'm trying to run a java daemon using jsvc and the Daemon interface. The 
> > java project is a jar file which has a bunch of dependencies in a manifest 
> > file (including commons-daemon), and I add this jar file to the classpath 
> > when running jsvc.
> >  When I try to execute via jsvc however, I get this stacktrace in stderr:
> >
> > java.lang.InstantiationException: com.mycomany.mypackage.MyClass
> > at java.lang.Class.newInstance(Class.java:359)
> > at 
> > org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
> > 17/07/2014 17:03:34 9904 jsvc.exec error: Cannot load daemon
> > 17/07/2014 17:03:34 9903 jsvc.exec error: Service exit with a return value 
> > of 3
> >
> > Where MyClass is the class that I pass into jsvc.
> >
> > I have tried using the -verbose option to help diagnose the problem, and 
> > with that I can see in stdout that it loads all the dependencies from the 
> > manifest just fine, but no additional information is provided to help 
> > diagnose the problem.
> >  Is there a way to get more information about what causes this 
> > InstantationException?
> >
> > Bes

RE: [daemon]

2014-07-17 Thread Andrew Martin
Hi Martin,

PATH= 
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/apache-maven-3.1.1/bin:/root/bin

I don't have JAVA_HOME set as an environment variable but I pass it into jsvc:  
/usr/lib/jvm/java-1.7.0

CLASSPATH: The  full pathname to my main jar. The manifest inside the jar has 
the rest of the dependencies, including commons-daemon. I know this is fine, 
because if I just run the jar using java -jar, it works. I also know that it is 
being passed correctly to jsvc, because when I remove it I get a more 
fundamental error.

Best,
Andrew

-Original Message-
From: Martin Gainty [mailto:mgai...@hotmail.com]
Sent: July-17-14 1:03 PM
To: Commons Users List
Subject: RE: [daemon]

can you display PATH, CLASSPATH and JAVA_HOME please
assume:
PATH folder = folders for all executables?
CLASSPATH folders = contains all classes referenced by main java 
class..including local folder e.g. $CLASSPATH = .:$CLASSPATH ?
files that are read are in SAME directory where you executed jsvc.exe ?
JAVA_HOME is set to base folder of JAVA installation ?

what happens when you run the same class using java.exe mypackage.MyClass ?

Martin
___


> From: andrew.mar...@exactearth.com
> To: user@commons.apache.org
> Subject: RE: [daemon]
> Date: Thu, 17 Jul 2014 16:42:51 +
>
> The output is identical to what I sent in the last email:
>
> java.lang.InstantiationException: mypackage.MyClass
> at java.lang.Class.newInstance(Class.java:359)
> at 
> org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
> 17/07/2014 17:39:24 10600 jsvc.exec error: Cannot load daemon
> 17/07/2014 17:39:24 10599 jsvc.exec error: Service exit with a return value 
> of 3
>
> This is from the error file. Nothing in the stdout file.
>
> Andrew
>
> -Original Message-
> From: Martin Gainty [mailto:mgai...@hotmail.com]
> Sent: July-17-14 12:37 PM
> To: Commons Users List
> Subject: RE: [daemon]
>
> jsvc.exe -outfile stdout.out -errfile stderr.errcat stdout.out cat stderr.err
>
> report back the results
> Martin
>
> From: andrew.mar...@exactearth.com
> To: user@commons.apache.org
> Subject: [daemon]
> Date: Thu, 17 Jul 2014 16:24:14 +
>
>
>
>
>
>
>
>
>
>
> Hi,
>
> I'm trying to run a java daemon using jsvc and the Daemon interface. The java 
> project is a jar file which has a bunch of dependencies in a manifest file 
> (including commons-daemon), and I add this jar file to the classpath when 
> running jsvc.
>  When I try to execute via jsvc however, I get this stacktrace in stderr:
>
> java.lang.InstantiationException: com.mycomany.mypackage.MyClass
> at java.lang.Class.newInstance(Class.java:359)
> at 
> org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
> 17/07/2014 17:03:34 9904 jsvc.exec error: Cannot load daemon
> 17/07/2014 17:03:34 9903 jsvc.exec error: Service exit with a return value of 
> 3
>
> Where MyClass is the class that I pass into jsvc.
>
> I have tried using the -verbose option to help diagnose the problem, and with 
> that I can see in stdout that it loads all the dependencies from the manifest 
> just fine, but no additional information is provided to help diagnose the 
> problem.
>  Is there a way to get more information about what causes this 
> InstantationException?
>
> Best,
> Andrew
>
>
>
>
>
>
>
>
>
>
>
>
> Andrew Martin
>
>
> Software Engineering Co-op, Software Development | exactEarth Ltd.
>
>
>
>
>
> 60 Struck Ct. Cambridge, Ontario N1R 8L2
>
>
> office. +1.519.622.4445
>
>
> email. andrew.mar...@exactearth.com
>
>
>
> web. www.exactearth.com
>
>
>
>
>
>
>
>
>
>
>
>
> This e-mail and any attachment is for authorized use by the intended 
> recipient(s) only. It contains proprietary or confidential information and is 
> not to be copied, disclosed to, retained or used by, any other party. If you 
> are not  an intended recipient then please promptly delete this e-mail, any 
> attachment and all copies and inform the sender. Thank you.
>
>
>
> Andrew Martin
> Software Engineering Co-op, Software Development | exactEarth Ltd.
> 60 Struck Ct. Cambridge, Ontario N1R 8L2
> office. +1.519.622.4445
> email. andrew.mar...@exactearth.com
> web. 
>
>
> This e-mail and any attachment is for authorized use by the intended 
> recipient(s) only. It contains proprietary or confidential information and is 
> not to be copied, disclosed to, retained or used by, any other party. If you 
> are not an intended recipient then please promptly delete this e-mail, any 
> 

RE: [daemon]

2014-07-17 Thread Martin Gainty
can you display PATH, CLASSPATH and JAVA_HOME please
assume:
PATH folder = folders for all executables?
CLASSPATH folders = contains all classes referenced by main java 
class..including local folder e.g. $CLASSPATH = .:$CLASSPATH ?
files that are read are in SAME directory where you executed jsvc.exe ?
JAVA_HOME is set to base folder of JAVA installation ?

what happens when you run the same class using java.exe mypackage.MyClass ?

Martin 
___


> From: andrew.mar...@exactearth.com
> To: user@commons.apache.org
> Subject: RE: [daemon]
> Date: Thu, 17 Jul 2014 16:42:51 +
> 
> The output is identical to what I sent in the last email:
> 
> java.lang.InstantiationException: mypackage.MyClass
> at java.lang.Class.newInstance(Class.java:359)
> at 
> org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
> 17/07/2014 17:39:24 10600 jsvc.exec error: Cannot load daemon
> 17/07/2014 17:39:24 10599 jsvc.exec error: Service exit with a return value 
> of 3
> 
> This is from the error file. Nothing in the stdout file.
> 
> Andrew
> 
> -Original Message-
> From: Martin Gainty [mailto:mgai...@hotmail.com]
> Sent: July-17-14 12:37 PM
> To: Commons Users List
> Subject: RE: [daemon]
> 
> jsvc.exe -outfile stdout.out -errfile stderr.errcat stdout.out cat stderr.err
> 
> report back the results
> Martin
> 
> From: andrew.mar...@exactearth.com
> To: user@commons.apache.org
> Subject: [daemon]
> Date: Thu, 17 Jul 2014 16:24:14 +
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Hi,
> 
> I'm trying to run a java daemon using jsvc and the Daemon interface. The java 
> project is a jar file which has a bunch of dependencies in a manifest file 
> (including commons-daemon), and I add this jar file to the classpath when 
> running jsvc.
>  When I try to execute via jsvc however, I get this stacktrace in stderr:
> 
> java.lang.InstantiationException: com.mycomany.mypackage.MyClass
> at java.lang.Class.newInstance(Class.java:359)
> at 
> org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
> 17/07/2014 17:03:34 9904 jsvc.exec error: Cannot load daemon
> 17/07/2014 17:03:34 9903 jsvc.exec error: Service exit with a return value of 
> 3
> 
> Where MyClass is the class that I pass into jsvc.
> 
> I have tried using the -verbose option to help diagnose the problem, and with 
> that I can see in stdout that it loads all the dependencies from the manifest 
> just fine, but no additional information is provided to help diagnose the 
> problem.
>  Is there a way to get more information about what causes this 
> InstantationException?
> 
> Best,
> Andrew
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Andrew Martin
> 
> 
> Software Engineering Co-op, Software Development | exactEarth Ltd.
> 
> 
> 
> 
> 
> 60 Struck Ct. Cambridge, Ontario N1R 8L2
> 
> 
> office. +1.519.622.4445
> 
> 
> email. andrew.mar...@exactearth.com
> 
> 
> 
> web. www.exactearth.com
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> This e-mail and any attachment is for authorized use by the intended 
> recipient(s) only. It contains proprietary or confidential information and is 
> not to be copied, disclosed to, retained or used by, any other party. If you 
> are not  an intended recipient then please promptly delete this e-mail, any 
> attachment and all copies and inform the sender. Thank you.
> 
> 
> 
> Andrew Martin
> Software Engineering Co-op, Software Development | exactEarth Ltd.
> 60 Struck Ct. Cambridge, Ontario N1R 8L2
> office. +1.519.622.4445
> email. andrew.mar...@exactearth.com
> web. 
> 
> 
> This e-mail and any attachment is for authorized use by the intended 
> recipient(s) only. It contains proprietary or confidential information and is 
> not to be copied, disclosed to, retained or used by, any other party. If you 
> are not an intended recipient then please promptly delete this e-mail, any 
> attachment and all copies and inform the sender. Thank you.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 
  

RE: [daemon]

2014-07-17 Thread Andrew Martin
The output is identical to what I sent in the last email:

java.lang.InstantiationException: mypackage.MyClass
at java.lang.Class.newInstance(Class.java:359)
at 
org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
17/07/2014 17:39:24 10600 jsvc.exec error: Cannot load daemon
17/07/2014 17:39:24 10599 jsvc.exec error: Service exit with a return value of 3

This is from the error file. Nothing in the stdout file.

Andrew

-Original Message-
From: Martin Gainty [mailto:mgai...@hotmail.com]
Sent: July-17-14 12:37 PM
To: Commons Users List
Subject: RE: [daemon]

jsvc.exe -outfile stdout.out -errfile stderr.errcat stdout.out cat stderr.err

report back the results
Martin

From: andrew.mar...@exactearth.com
To: user@commons.apache.org
Subject: [daemon]
Date: Thu, 17 Jul 2014 16:24:14 +










Hi,

I'm trying to run a java daemon using jsvc and the Daemon interface. The java 
project is a jar file which has a bunch of dependencies in a manifest file 
(including commons-daemon), and I add this jar file to the classpath when 
running jsvc.
 When I try to execute via jsvc however, I get this stacktrace in stderr:

java.lang.InstantiationException: com.mycomany.mypackage.MyClass
at java.lang.Class.newInstance(Class.java:359)
at 
org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
17/07/2014 17:03:34 9904 jsvc.exec error: Cannot load daemon
17/07/2014 17:03:34 9903 jsvc.exec error: Service exit with a return value of 3

Where MyClass is the class that I pass into jsvc.

I have tried using the -verbose option to help diagnose the problem, and with 
that I can see in stdout that it loads all the dependencies from the manifest 
just fine, but no additional information is provided to help diagnose the 
problem.
 Is there a way to get more information about what causes this 
InstantationException?

Best,
Andrew












Andrew Martin


Software Engineering Co-op, Software Development | exactEarth Ltd.





60 Struck Ct. Cambridge, Ontario N1R 8L2


office. +1.519.622.4445


email. andrew.mar...@exactearth.com



web. www.exactearth.com












This e-mail and any attachment is for authorized use by the intended 
recipient(s) only. It contains proprietary or confidential information and is 
not to be copied, disclosed to, retained or used by, any other party. If you 
are not  an intended recipient then please promptly delete this e-mail, any 
attachment and all copies and inform the sender. Thank you.



Andrew Martin
Software Engineering Co-op, Software Development | exactEarth Ltd.
60 Struck Ct. Cambridge, Ontario N1R 8L2
office. +1.519.622.4445
email. andrew.mar...@exactearth.com
web. 


This e-mail and any attachment is for authorized use by the intended 
recipient(s) only. It contains proprietary or confidential information and is 
not to be copied, disclosed to, retained or used by, any other party. If you 
are not an intended recipient then please promptly delete this e-mail, any 
attachment and all copies and inform the sender. Thank you.


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



RE: [daemon]

2014-07-17 Thread Martin Gainty
jsvc.exe -outfile stdout.out -errfile stderr.errcat stdout.out
cat stderr.err

report back the results
Martin

From: andrew.mar...@exactearth.com
To: user@commons.apache.org
Subject: [daemon]
Date: Thu, 17 Jul 2014 16:24:14 +










Hi,
 
I’m trying to run a java daemon using jsvc and the Daemon interface. The java 
project is a jar file which has a bunch of dependencies in a manifest file 
(including commons-daemon), and I add this jar file to the classpath when 
running jsvc.
 When I try to execute via jsvc however, I get this stacktrace in stderr:
 
java.lang.InstantiationException: com.mycomany.mypackage.MyClass
at java.lang.Class.newInstance(Class.java:359)
at 
org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:190)
17/07/2014 17:03:34 9904 jsvc.exec error: Cannot load daemon
17/07/2014 17:03:34 9903 jsvc.exec error: Service exit with a return value of 3
 
Where MyClass is the class that I pass into jsvc.
 
I have tried using the –verbose option to help diagnose the problem, and with 
that I can see in stdout that it loads all the dependencies from the manifest 
just fine, but no additional information is provided to help diagnose the 
problem.
 Is there a way to get more information about what causes this 
InstantationException?
 
Best,
Andrew











 
Andrew Martin


Software Engineering Co-op, Software Development | exactEarth Ltd.


 


60 Struck Ct. Cambridge, Ontario N1R 8L2


office. +1.519.622.4445 


email. andrew.mar...@exactearth.com



web. www.exactearth.com





 






This e-mail and any attachment is for authorized use by the intended 
recipient(s) only. It contains proprietary or confidential information and is 
not to be copied, disclosed to, retained or used by, any other party. If you 
are not
 an intended recipient then please promptly delete this e-mail, any attachment 
and all copies and inform the sender. Thank you.
  

Re: [daemon]

2014-06-16 Thread sebb
On 16 June 2014 23:51, Jian Le  wrote:
> Hi, I would like to submit a minor change to the
> commons-daemon-1.0.x-src/src/native/unix/support/apsupport.m4 file such
> that it will support the zlinux platform.   However, when I clicked the
> Contributing Patches menu item on the left panel of your main page (
> http://commons.apache.org/proper/commons-daemon/jsvc.html), it did not
> work.

Sorry about the broken links

> Please let me know the appropriate process for me to submit this
> change.   -Jian

Follow the link to the issue tracking system via

Project Information / Issue Tracking

i.e.

http://commons.apache.org/proper/commons-daemon/issue-tracking.html

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



Re: [daemon]

2014-04-05 Thread Mladen Turk

On 03/25/2014 04:25 PM, Freddie wrote:



Depending what your thread does. Does it require some user input, access to

some resource.

Yes it starts a server when started from the parameters given when I created
the service.
 From cmd I can send it commands to check that it is running, the command that
causes it to hang though will create a new thread then execute a series of
bat files until told to stop.



Well if it requires any user interaction that won't work and can cause
hang (waiting on user input) because services since Windows Vista run
in Session 0, and prevent direct user interaction. The only way you can
communicate to a service is by using some IPC mechanism.


Regards
--
^TM

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



Re: [daemon]

2014-03-25 Thread Freddie

> Depending what your thread does. Does it require some user input, access to 
some resource.

Yes it starts a server when started from the parameters given when I created 
the service. 
>From cmd I can send it commands to check that it is running, the command that 
causes it to hang though will create a new thread then execute a series of 
bat files until told to stop.

> On which windows version is this? Also what about stack and memory sizes?

Windows 7 64bit, Stack size 4000, memory size max 1024 and initial is 256

Thanks






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



Re: [daemon]

2014-03-25 Thread Mladen Turk

On 03/20/2014 04:05 PM, Van der Neut, Frederick wrote:

Hi,

Is this a limitation of procrun? What else could be causing the service to lock 
up like this?



Depending what your thread does. Does it require some user input, access to 
some resource.
On which windows version is this? Also what about stack and memory sizes?


Regards
--
^TM

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



Re: [daemon]

2014-03-24 Thread Freddie
Martin Gainty  hotmail.com> writes:

> 
> 
> > From: frederick.van-der-neut  hp.com
> > To: user  commons.apache.org
> > Subject: [daemon]
> > Date: Thu, 20 Mar 2014 15:05:05 +
> > 
> > Hi,
> > 
> > I have been having an issue where the windows service I created will 
hang. I was able to start my java program
> as a Network Service. It starts and stops fine I can also send it a 
command from cmd to check the client
> status, but whenever I send it a command to spawn a new thread it sits 
there hung up until I end the process.
> > 
> > The program works fine in both eclipse and running it standalone from 
cmd. Only when it is a service do I get issues.
> > 
> > Is this a limitation of procrun? What else could be causing the service 
to lock up like this?
> MG>I'll ask the obvious questions:
> MG>Did you set the procrun -Jvm parameter so jvm.dll will load
> MG>If so then youll need to set --StartMode jvm
> 
> MG>What is in your registry located at:
> MG>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
> MG>HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\ProcRun 2.0\
\Parameters
> MG>HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software 
Foundation\ProcRun 2.0\
> 
> MG>Also daemonizing a exe or java binary has these consequences:
> 
> When using the Java or exe modes, the Procrun service application 
(prunsrv) launches the target
> application in a separate process. The "stop" application needs to 
communicate somehow with the "start"
> application to tell it to stop. For example, using RPC. 
> 
> > 
> > Thanks,
> > Freddie
> MG>Wo arbeitest du
> MG>Martin   


Hi Martin,

Yes the JVM parameters are set so the jvm.dll will load

The service is located in two locations of the registry.
> MG>What is in your registry located at:
> MG>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
> MG>HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software 
Foundation\ProcRun 2.0\

Thanks,
Freddie


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



RE: [daemon]

2014-03-20 Thread Martin Gainty


  


> From: frederick.van-der-n...@hp.com
> To: user@commons.apache.org
> Subject: [daemon]
> Date: Thu, 20 Mar 2014 15:05:05 +
> 
> Hi,
> 
> I have been having an issue where the windows service I created will hang. I 
> was able to start my java program as a Network Service. It starts and stops 
> fine I can also send it a command from cmd to check the client status, but 
> whenever I send it a command to spawn a new thread it sits there hung up 
> until I end the process.
> 
> The program works fine in both eclipse and running it standalone from cmd. 
> Only when it is a service do I get issues.
> 
> Is this a limitation of procrun? What else could be causing the service to 
> lock up like this?
MG>I'll ask the obvious questions:
MG>Did you set the procrun -Jvm parameter so jvm.dll will load
MG>If so then youll need to set --StartMode jvm
 
MG>What is in your registry located at:
MG>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
MG>HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\ProcRun 
2.0\\Parameters
MG>HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\ProcRun 
2.0\

MG>Also daemonizing a exe or java binary has these consequences:

When using the Java or exe modes, the Procrun service application (prunsrv) 
launches the target application in a separate process. The "stop" application 
needs to communicate somehow with the "start" application to tell it to stop. 
For example, using RPC. 


> 
> Thanks,
> Freddie
MG>Wo arbeitest du
MG>Martin 

Re: [daemon] Can't start jvsc on OSX 10.8

2014-02-14 Thread Amos Anderson
Thanks for the hint, Ian, and thanks for your patches!

Amos.



On Feb 13, 2014, at 6:33 PM, Ian Emmons  wrote:

> This bug (#281, see URL below) has been fixed and the fix has been committed. 
>  However, there has been no release since that time.
> 
> https://issues.apache.org/jira/browse/DAEMON-281
> 
> 
> On Feb 13, 2014, at 2:30 PM, Amos Anderson  wrote:
>> Hello --
>> 
>> I'm trying to start tomcat 7.0.50 on my OSX 10.8 machine following the 
>> instructions here:
>> http://tomcat.apache.org/tomcat-7.0-doc/setup.html#Unix_daemon
>> 
>> Version 1.0.15 of the commons daemon was bundled with tomcat. I built jsvc 
>> with this command:
>> sudo ./configure 
>> --with-java=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
>> 
>> and then I'm trying to use the daemon.sh script to start the service. My 
>> catalina log file says:
>> 
>> Cannot find any VM in Java Home 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
>> Cannot locate JVM library file
>> java_init failed
>> Service exit with a return value of 1
>> 
>> 
>> So I passed the -debug flag to jsvc to see what's happening:
>> 
>> sudo ./daemon.sh --tomcat-user _www --java-home 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home start
>> 
>> Output is pasted below. It's clear that the problem is that the layout of 
>> the directories is not what jsvc is expecting:
>> 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents> ls -l
>> total 8
>> drwxrwxr-x   3 root  wheel   102B Feb 13 09:31 MacOS/
>> drwxrwxr-x  15 root  wheel   510B Dec 18 19:16 Home/
>> -rw-rw-r--   1 root  wheel   1.5K Dec 18 19:13 Info.plist
>> 
>> 
>> Any help?
>> 
>> Thanks!
>> Amos.
>> 
>> 
>> 
>> 
>> 
>> /usr/local/apache-tomcat-7.0.50/bin> sudo ./daemon.sh --tomcat-user _www 
>> --java-home /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home 
>> start
>> +-- DUMPING PARSED COMMAND LINE ARGUMENTS --
>> | Detach:  True
>> | Show Version:No
>> | Show Help:   No
>> | Check Only:  Disabled
>> | Stop:False
>> | Wait:10
>> | Run as service:  No
>> | Install service: No
>> | Remove service:  No
>> | JVM Name:"null"
>> | Java Home:   
>> "/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home"
>> | PID File:"/usr/local/apache-tomcat-7.0.50/logs/catalina-daemon.pid"
>> | User Name:   "_www"
>> | Extra Options:   7
>> |   
>> "-Djava.class.path=/usr/local/apache-tomcat-7.0.50/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.50/bin/commons-daemon.jar:/usr/local/apache-tomcat-7.0.50/bin/tomcat-juli.jar"
>> |   
>> "-Djava.util.logging.config.file=/usr/local/apache-tomcat-7.0.50/conf/logging.properties"
>> |   "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
>> |   "-Djava.endorsed.dirs="
>> |   "-Dcatalina.base=/usr/local/apache-tomcat-7.0.50"
>> |   "-Dcatalina.home=/usr/local/apache-tomcat-7.0.50"
>> |   "-Djava.io.tmpdir=/usr/local/apache-tomcat-7.0.50/temp"
>> | Class Invoked:   "org.apache.catalina.startup.Bootstrap"
>> | Class Arguments: 0
>> +---
>> user changed to '_www'
>> User '_www' validated
>> Attempting to locate Java Home in 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
>> Attempting to locate VM configuration file 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jvm.cfg
>> Found VM configuration file at 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jvm.cfg
>> Found VM server definition in configuration
>> Checking library 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libserver.dylib
>> Cannot locate library for VM server (skipping)
>> Found VM client definition in configuration
>> Checking library 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libclient.dylib
>> Cannot locate library for VM client (skipping)
>> Found VM hotspot definition in configuration
>> Checking library 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libhotspot.dylib
>> Cannot locate library for VM hotspot (skipping)
>> Found VM classic definition in configuration
>> Checking library 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libclassic.dylib
>> Cannot locate library for VM classic (skipping)
>> Found VM native definition in configuration
>> Checking library 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libnative.dylib
>> Cannot locate library for VM native (skipping)
>> Found VM green definition in configuration
>> Checking library 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libgreen.dylib
>> Cannot locate library for VM green (skipping)
>> Java Home located in 
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
>> +-- DUMPING JAVA HOME STRUCTURE 
>> | Jav

Re: [daemon] Can't start jvsc on OSX 10.8

2014-02-13 Thread Ian Emmons
This bug (#281, see URL below) has been fixed and the fix has been committed.  
However, there has been no release since that time.

https://issues.apache.org/jira/browse/DAEMON-281


On Feb 13, 2014, at 2:30 PM, Amos Anderson  wrote:
> Hello --
> 
> I'm trying to start tomcat 7.0.50 on my OSX 10.8 machine following the 
> instructions here:
> http://tomcat.apache.org/tomcat-7.0-doc/setup.html#Unix_daemon
> 
> Version 1.0.15 of the commons daemon was bundled with tomcat. I built jsvc 
> with this command:
> sudo ./configure 
> --with-java=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
> 
> and then I'm trying to use the daemon.sh script to start the service. My 
> catalina log file says:
> 
> Cannot find any VM in Java Home 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
> Cannot locate JVM library file
> java_init failed
> Service exit with a return value of 1
> 
> 
> So I passed the -debug flag to jsvc to see what's happening:
> 
> sudo ./daemon.sh --tomcat-user _www --java-home 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home start
> 
> Output is pasted below. It's clear that the problem is that the layout of the 
> directories is not what jsvc is expecting:
> 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents> ls -l
> total 8
> drwxrwxr-x   3 root  wheel   102B Feb 13 09:31 MacOS/
> drwxrwxr-x  15 root  wheel   510B Dec 18 19:16 Home/
> -rw-rw-r--   1 root  wheel   1.5K Dec 18 19:13 Info.plist
> 
> 
> Any help?
> 
> Thanks!
> Amos.
> 
> 
> 
> 
> 
> /usr/local/apache-tomcat-7.0.50/bin> sudo ./daemon.sh --tomcat-user _www 
> --java-home /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home 
> start
> +-- DUMPING PARSED COMMAND LINE ARGUMENTS --
> | Detach:  True
> | Show Version:No
> | Show Help:   No
> | Check Only:  Disabled
> | Stop:False
> | Wait:10
> | Run as service:  No
> | Install service: No
> | Remove service:  No
> | JVM Name:"null"
> | Java Home:   
> "/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home"
> | PID File:"/usr/local/apache-tomcat-7.0.50/logs/catalina-daemon.pid"
> | User Name:   "_www"
> | Extra Options:   7
> |   
> "-Djava.class.path=/usr/local/apache-tomcat-7.0.50/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.50/bin/commons-daemon.jar:/usr/local/apache-tomcat-7.0.50/bin/tomcat-juli.jar"
> |   
> "-Djava.util.logging.config.file=/usr/local/apache-tomcat-7.0.50/conf/logging.properties"
> |   "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
> |   "-Djava.endorsed.dirs="
> |   "-Dcatalina.base=/usr/local/apache-tomcat-7.0.50"
> |   "-Dcatalina.home=/usr/local/apache-tomcat-7.0.50"
> |   "-Djava.io.tmpdir=/usr/local/apache-tomcat-7.0.50/temp"
> | Class Invoked:   "org.apache.catalina.startup.Bootstrap"
> | Class Arguments: 0
> +---
> user changed to '_www'
> User '_www' validated
> Attempting to locate Java Home in 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
> Attempting to locate VM configuration file 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jvm.cfg
> Found VM configuration file at 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jvm.cfg
> Found VM server definition in configuration
> Checking library 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libserver.dylib
> Cannot locate library for VM server (skipping)
> Found VM client definition in configuration
> Checking library 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libclient.dylib
> Cannot locate library for VM client (skipping)
> Found VM hotspot definition in configuration
> Checking library 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libhotspot.dylib
> Cannot locate library for VM hotspot (skipping)
> Found VM classic definition in configuration
> Checking library 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libclassic.dylib
> Cannot locate library for VM classic (skipping)
> Found VM native definition in configuration
> Checking library 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libnative.dylib
> Cannot locate library for VM native (skipping)
> Found VM green definition in configuration
> Checking library 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/../Libraries/libgreen.dylib
> Cannot locate library for VM green (skipping)
> Java Home located in 
> /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
> +-- DUMPING JAVA HOME STRUCTURE 
> | Java Home:   
> "/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home"
> | Java VM Config.: 
> "/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jvm.cfg"
> | Found JVMs:  0
> +-

Re: [daemon] running https server with ‘common daemon(jsvc)’ generates ‘Permission denied’ error

2013-12-03 Thread sebb
On 3 December 2013 08:19, JinHwan Hwang  wrote:
> By googling, I know that there are some issue if i use port number which is
> under 1000 without root privileges. But in my case, i have run jsvc with
> root account and all the involving files have ‘chmod 755’ permission. Https
> server are created by using restlet with jetty container. What will cause
> this annoying permission error besides permission of files? Moreover, https
> server works fine when i run without jsvc(directly run jar file). I have
> post error message and all the sample code which i used below.
>
> Thanks in advance for any help
>
> *jsvc error output*
>
> 2013-12-03 16:38:53.248:WARN:oejuc.AbstractLifeCycle:FAILED
> SslSelectChannelConnector@0.0.0.0:443: java.net.SocketException:
> Permission denied
> java.net.SocketException: Permission denied
> at sun.nio.ch.Net.bind(Native Method)
> at 
> sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126)
> at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
> at 
> org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
> at 
> org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
> at 
> org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
> at 
> org.eclipse.jetty.server.ssl.SslSelectChannelConnector.doStart(SslSelectChannelConnector.java:631)
> at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> at org.eclipse.jetty.server.Server.doStart(Server.java:293)
> at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
> at 
> org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:398)
> at org.restlet.Server.start(Server.java:590)
> at org.restlet.Component.startServers(Component.java:611)
> at org.restlet.Component.start(Component.java:538)
> at JettyServerExample.main(JettyServerExample.java:26)
> at CmmDaemon.start(CmmDaemon.java:23)

I think you need to bind to the socket earlier, in the init() method.

By the time start() is called, the process has dropped root privs.

See:
http://commons.apache.org/proper/commons-daemon/jsvc.html

in particular
http://commons.apache.org/proper/commons-daemon/jsvc.html#Directly
et seq.

> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at 
> org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:243)

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



Re: [daemon] ClassNotFoundException though class in path

2013-11-19 Thread Thad Humphries
Ha! I can still be lazy thanks to the -outfile param.

Thanks again for all the help.


On Tue, Nov 19, 2013 at 2:13 PM, Thad Humphries wrote:

> Thanks. That seems to have done it. And adding "-pidfile /var/run/jsvc.pid
> -stop" stops it.
>
> However now I don't see the System.out.println() that I was (lazily) using
> to track MultiThread and its three SubTreads. I guess I've got to swap
> those for a logger if I want to see anything, huh?
>
>
> On Tue, Nov 19, 2013 at 1:40 PM, Thomas Neidhart <
> thomas.neidh...@gmail.com> wrote:
>
>> On 11/19/2013 07:35 PM, Thad Humphries wrote:
>> > Different error this time (see list below).
>> >
>> > The failure is "2013-11-19 13:10:48.376 jsvc[18273:203] Apple AWT Java
>> VM
>> > was loaded on first thread -- can't start AWT.
>> > java.lang.InternalError: Can't start the AWT because Java was started on
>> > the first thread.  Make sure StartOnFirstThread is not specified in your
>> > application's Info.plist or on the command line"
>>
>> well, I do not know what you are trying to do, but you may want to try
>> out the headless mode:
>>
>> http://www.oracle.com/technetwork/articles/javase/headless-136834.html
>>
>> Thomas
>>
>> > However I find no "StartOnFirstThread" in the Info.plist.
>> >
>> > Question: MultiThread spawns 3 threads of SubThread. Could that be the
>> > problem? A thread that spawns threads? MultiThread grabs AWT so
>> SubThread's
>> > can't (though neither user AWT classes).
>> >
>> > I had been using a JVM shutdown
>> > hookfor
>> > MultiThread and assigning a shutdown hook to each of the SubThread
>> > instances. In my target app, I want to give the user one process to
>> start
>> > via a shell script with the subthreads (variable in number) configured
>> in
>> > an XML file. I just today started looking at Daemon thinking it might
>> be a
>> > better way to go, especially as I'd also like this eventually to run as
>> a
>> > Windows service (beat writing a *.BAT file).
>> >
>> > Debug follows:
>> >
>> > $ sudo ~/bin/jsvc -jvm server -debug -cp
>> >
>> /Users/thad/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:/Users/thad/jdevel/MultiThreadTest/target/MultiThread-1.0-SNAPSHOT.jar
>> > com.mindwrap.sample.thread.MultiThread once
>> > +-- DUMPING PARSED COMMAND LINE ARGUMENTS --
>> > | Detach:  True
>> > | Show Version:No
>> > | Show Help:   No
>> > | Check Only:  Disabled
>> > | Stop:False
>> > | Wait:0
>> > | Run as service:  No
>> > | Install service: No
>> > | Remove service:  No
>> > | JVM Name:"server"
>> > | Java Home:   "null"
>> > | PID File:"/var/run/jsvc.pid"
>> > | User Name:   "null"
>> > | Extra Options:   1
>> > |
>> >
>> "-Djava.class.path=/Users/thad/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:/Users/thad/jdevel/MultiThreadTest/target/MultiThread-1.0-SNAPSHOT.jar"
>> > | Class Invoked:   "com.mindwrap.sample.thread.MultiThread"
>> > | Class Arguments: 1
>> > |   "once"
>> > +---
>> > Home not specified on command line, using environment
>> > Home not on command line or in environment, searching
>> > Attempting to locate Java Home in
>> > /System/Library/Frameworks/JavaVM.framework/Home
>> > Attempting to locate VM configuration file
>> > /System/Library/Frameworks/JavaVM.framework/Home/jre/lib/jvm.cfg
>> > Attempting to locate VM configuration file
>> > /System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg
>> > Found VM configuration file at
>> > /System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg
>> > Found VM client definition in configuration
>> > Checking library
>> >
>> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclient.dylib
>> > Found VM jvm definition in configuration
>> > Checking library
>> >
>> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libjvm.dylib
>> > Found VM hotspot definition in configuration
>> > Checking library
>> >
>> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libhotspot.dylib
>> > Found VM server definition in configuration
>> > Checking library
>> >
>> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
>> > Found VM classic definition in configuration
>> > Checking library
>> >
>> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclassic.dylib
>> > Cannot locate library for VM classic (skipping)
>> > Java Home located in /System/Library/Frameworks/JavaVM.framework/Home
>> > +-- DUMPING JAVA HOME STRUCTURE 
>> > | Java Home:   "/System/Library/Frameworks/JavaVM.framework/Home"
>> > | Java VM Config.:
>> > "/System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg"
>> > | Found JVMs:  4
>> > | JVM Name:"client"
>> > |
>> >
>>  
>> "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclient.dylib"
>

Re: [daemon] ClassNotFoundException though class in path

2013-11-19 Thread Thad Humphries
Thanks. That seems to have done it. And adding "-pidfile /var/run/jsvc.pid
-stop" stops it.

However now I don't see the System.out.println() that I was (lazily) using
to track MultiThread and its three SubTreads. I guess I've got to swap
those for a logger if I want to see anything, huh?


On Tue, Nov 19, 2013 at 1:40 PM, Thomas Neidhart
wrote:

> On 11/19/2013 07:35 PM, Thad Humphries wrote:
> > Different error this time (see list below).
> >
> > The failure is "2013-11-19 13:10:48.376 jsvc[18273:203] Apple AWT Java VM
> > was loaded on first thread -- can't start AWT.
> > java.lang.InternalError: Can't start the AWT because Java was started on
> > the first thread.  Make sure StartOnFirstThread is not specified in your
> > application's Info.plist or on the command line"
>
> well, I do not know what you are trying to do, but you may want to try
> out the headless mode:
>
> http://www.oracle.com/technetwork/articles/javase/headless-136834.html
>
> Thomas
>
> > However I find no "StartOnFirstThread" in the Info.plist.
> >
> > Question: MultiThread spawns 3 threads of SubThread. Could that be the
> > problem? A thread that spawns threads? MultiThread grabs AWT so
> SubThread's
> > can't (though neither user AWT classes).
> >
> > I had been using a JVM shutdown
> > hookfor
> > MultiThread and assigning a shutdown hook to each of the SubThread
> > instances. In my target app, I want to give the user one process to start
> > via a shell script with the subthreads (variable in number) configured in
> > an XML file. I just today started looking at Daemon thinking it might be
> a
> > better way to go, especially as I'd also like this eventually to run as a
> > Windows service (beat writing a *.BAT file).
> >
> > Debug follows:
> >
> > $ sudo ~/bin/jsvc -jvm server -debug -cp
> >
> /Users/thad/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:/Users/thad/jdevel/MultiThreadTest/target/MultiThread-1.0-SNAPSHOT.jar
> > com.mindwrap.sample.thread.MultiThread once
> > +-- DUMPING PARSED COMMAND LINE ARGUMENTS --
> > | Detach:  True
> > | Show Version:No
> > | Show Help:   No
> > | Check Only:  Disabled
> > | Stop:False
> > | Wait:0
> > | Run as service:  No
> > | Install service: No
> > | Remove service:  No
> > | JVM Name:"server"
> > | Java Home:   "null"
> > | PID File:"/var/run/jsvc.pid"
> > | User Name:   "null"
> > | Extra Options:   1
> > |
> >
> "-Djava.class.path=/Users/thad/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:/Users/thad/jdevel/MultiThreadTest/target/MultiThread-1.0-SNAPSHOT.jar"
> > | Class Invoked:   "com.mindwrap.sample.thread.MultiThread"
> > | Class Arguments: 1
> > |   "once"
> > +---
> > Home not specified on command line, using environment
> > Home not on command line or in environment, searching
> > Attempting to locate Java Home in
> > /System/Library/Frameworks/JavaVM.framework/Home
> > Attempting to locate VM configuration file
> > /System/Library/Frameworks/JavaVM.framework/Home/jre/lib/jvm.cfg
> > Attempting to locate VM configuration file
> > /System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg
> > Found VM configuration file at
> > /System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg
> > Found VM client definition in configuration
> > Checking library
> >
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclient.dylib
> > Found VM jvm definition in configuration
> > Checking library
> >
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libjvm.dylib
> > Found VM hotspot definition in configuration
> > Checking library
> >
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libhotspot.dylib
> > Found VM server definition in configuration
> > Checking library
> >
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
> > Found VM classic definition in configuration
> > Checking library
> >
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclassic.dylib
> > Cannot locate library for VM classic (skipping)
> > Java Home located in /System/Library/Frameworks/JavaVM.framework/Home
> > +-- DUMPING JAVA HOME STRUCTURE 
> > | Java Home:   "/System/Library/Frameworks/JavaVM.framework/Home"
> > | Java VM Config.:
> > "/System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg"
> > | Found JVMs:  4
> > | JVM Name:"client"
> > |
> >
>  
> "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclient.dylib"
> > | JVM Name:"jvm"
> > |
> >
>  "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libjvm.dylib"
> > | JVM Name:"hotspot"
> > |
> >
>  
> "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libhotspot.dylib"
> > | JVM Name:"server"
> > |
> >
>  
> "/System/L

Re: [daemon] ClassNotFoundException though class in path

2013-11-19 Thread Thomas Neidhart
On 11/19/2013 07:35 PM, Thad Humphries wrote:
> Different error this time (see list below).
> 
> The failure is "2013-11-19 13:10:48.376 jsvc[18273:203] Apple AWT Java VM
> was loaded on first thread -- can't start AWT.
> java.lang.InternalError: Can't start the AWT because Java was started on
> the first thread.  Make sure StartOnFirstThread is not specified in your
> application's Info.plist or on the command line"

well, I do not know what you are trying to do, but you may want to try
out the headless mode:

http://www.oracle.com/technetwork/articles/javase/headless-136834.html

Thomas

> However I find no "StartOnFirstThread" in the Info.plist.
> 
> Question: MultiThread spawns 3 threads of SubThread. Could that be the
> problem? A thread that spawns threads? MultiThread grabs AWT so SubThread's
> can't (though neither user AWT classes).
> 
> I had been using a JVM shutdown
> hookfor
> MultiThread and assigning a shutdown hook to each of the SubThread
> instances. In my target app, I want to give the user one process to start
> via a shell script with the subthreads (variable in number) configured in
> an XML file. I just today started looking at Daemon thinking it might be a
> better way to go, especially as I'd also like this eventually to run as a
> Windows service (beat writing a *.BAT file).
> 
> Debug follows:
> 
> $ sudo ~/bin/jsvc -jvm server -debug -cp
> /Users/thad/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:/Users/thad/jdevel/MultiThreadTest/target/MultiThread-1.0-SNAPSHOT.jar
> com.mindwrap.sample.thread.MultiThread once
> +-- DUMPING PARSED COMMAND LINE ARGUMENTS --
> | Detach:  True
> | Show Version:No
> | Show Help:   No
> | Check Only:  Disabled
> | Stop:False
> | Wait:0
> | Run as service:  No
> | Install service: No
> | Remove service:  No
> | JVM Name:"server"
> | Java Home:   "null"
> | PID File:"/var/run/jsvc.pid"
> | User Name:   "null"
> | Extra Options:   1
> |
> "-Djava.class.path=/Users/thad/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:/Users/thad/jdevel/MultiThreadTest/target/MultiThread-1.0-SNAPSHOT.jar"
> | Class Invoked:   "com.mindwrap.sample.thread.MultiThread"
> | Class Arguments: 1
> |   "once"
> +---
> Home not specified on command line, using environment
> Home not on command line or in environment, searching
> Attempting to locate Java Home in
> /System/Library/Frameworks/JavaVM.framework/Home
> Attempting to locate VM configuration file
> /System/Library/Frameworks/JavaVM.framework/Home/jre/lib/jvm.cfg
> Attempting to locate VM configuration file
> /System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg
> Found VM configuration file at
> /System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg
> Found VM client definition in configuration
> Checking library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclient.dylib
> Found VM jvm definition in configuration
> Checking library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libjvm.dylib
> Found VM hotspot definition in configuration
> Checking library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libhotspot.dylib
> Found VM server definition in configuration
> Checking library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
> Found VM classic definition in configuration
> Checking library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclassic.dylib
> Cannot locate library for VM classic (skipping)
> Java Home located in /System/Library/Frameworks/JavaVM.framework/Home
> +-- DUMPING JAVA HOME STRUCTURE 
> | Java Home:   "/System/Library/Frameworks/JavaVM.framework/Home"
> | Java VM Config.:
> "/System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg"
> | Found JVMs:  4
> | JVM Name:"client"
> |
>  
> "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclient.dylib"
> | JVM Name:"jvm"
> |
>  "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libjvm.dylib"
> | JVM Name:"hotspot"
> |
>  
> "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libhotspot.dylib"
> | JVM Name:"server"
> |
>  
> "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib"
> +---
> redirecting stdout to /dev/null and stderr to /dev/null
> Switching umask back to 022 from 077
> 
> thad@Thads-Mac-mini.local:~/jdevel/MultiThreadTest
> 630 $ Using specific JVM in
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
> Attemtping to load library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
> JVM library
> /System/Library/Frameworks/JavaVM.framework/Home/..

Re: [daemon] ClassNotFoundException though class in path

2013-11-19 Thread Thad Humphries
Different error this time (see list below).

The failure is "2013-11-19 13:10:48.376 jsvc[18273:203] Apple AWT Java VM
was loaded on first thread -- can't start AWT.
java.lang.InternalError: Can't start the AWT because Java was started on
the first thread.  Make sure StartOnFirstThread is not specified in your
application's Info.plist or on the command line"

However I find no "StartOnFirstThread" in the Info.plist.

Question: MultiThread spawns 3 threads of SubThread. Could that be the
problem? A thread that spawns threads? MultiThread grabs AWT so SubThread's
can't (though neither user AWT classes).

I had been using a JVM shutdown
hookfor
MultiThread and assigning a shutdown hook to each of the SubThread
instances. In my target app, I want to give the user one process to start
via a shell script with the subthreads (variable in number) configured in
an XML file. I just today started looking at Daemon thinking it might be a
better way to go, especially as I'd also like this eventually to run as a
Windows service (beat writing a *.BAT file).

Debug follows:

$ sudo ~/bin/jsvc -jvm server -debug -cp
/Users/thad/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:/Users/thad/jdevel/MultiThreadTest/target/MultiThread-1.0-SNAPSHOT.jar
com.mindwrap.sample.thread.MultiThread once
+-- DUMPING PARSED COMMAND LINE ARGUMENTS --
| Detach:  True
| Show Version:No
| Show Help:   No
| Check Only:  Disabled
| Stop:False
| Wait:0
| Run as service:  No
| Install service: No
| Remove service:  No
| JVM Name:"server"
| Java Home:   "null"
| PID File:"/var/run/jsvc.pid"
| User Name:   "null"
| Extra Options:   1
|
"-Djava.class.path=/Users/thad/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:/Users/thad/jdevel/MultiThreadTest/target/MultiThread-1.0-SNAPSHOT.jar"
| Class Invoked:   "com.mindwrap.sample.thread.MultiThread"
| Class Arguments: 1
|   "once"
+---
Home not specified on command line, using environment
Home not on command line or in environment, searching
Attempting to locate Java Home in
/System/Library/Frameworks/JavaVM.framework/Home
Attempting to locate VM configuration file
/System/Library/Frameworks/JavaVM.framework/Home/jre/lib/jvm.cfg
Attempting to locate VM configuration file
/System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg
Found VM configuration file at
/System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg
Found VM client definition in configuration
Checking library
/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclient.dylib
Found VM jvm definition in configuration
Checking library
/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libjvm.dylib
Found VM hotspot definition in configuration
Checking library
/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libhotspot.dylib
Found VM server definition in configuration
Checking library
/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
Found VM classic definition in configuration
Checking library
/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclassic.dylib
Cannot locate library for VM classic (skipping)
Java Home located in /System/Library/Frameworks/JavaVM.framework/Home
+-- DUMPING JAVA HOME STRUCTURE 
| Java Home:   "/System/Library/Frameworks/JavaVM.framework/Home"
| Java VM Config.:
"/System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg"
| Found JVMs:  4
| JVM Name:"client"
|
 "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclient.dylib"
| JVM Name:"jvm"
|
 "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libjvm.dylib"
| JVM Name:"hotspot"
|
 
"/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libhotspot.dylib"
| JVM Name:"server"
|
 "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib"
+---
redirecting stdout to /dev/null and stderr to /dev/null
Switching umask back to 022 from 077

thad@Thads-Mac-mini.local:~/jdevel/MultiThreadTest
630 $ Using specific JVM in
/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
Attemtping to load library
/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
JVM library
/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
loaded
Attemtping to load library
/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libverify.dylib
Shell library
/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libverify.dylib
loaded
JVM library entry point found (0x07433762)
+-- DUMPING JAVA VM CREATION ARGUMENTS -
| Version:   0x010004
| Ignore Unrecognized Arguments: False
| Extra options:

Re: [daemon] ClassNotFoundException though class in path

2013-11-19 Thread Thomas Neidhart
On 11/19/2013 06:11 PM, Thad Humphries wrote:
> I've written a class called MultiThread which implements Daemon. However
> when I try to run it with jsvc, it fails although the class is clearly
> present in my classpath. What am I not seeing? The call and debug are below:
> 
> $ sudo ~/bin/jsvc -jvm server -debug -cp
> ~/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:./target/MultiThread-1.0-SNAPSHOT.jar
> com.mindwrap.sample.thread.MultiThread once

try using an absolute path to the MultiThread jar file.

Thomas

> Password:
> +-- DUMPING PARSED COMMAND LINE ARGUMENTS --
> | Detach:  True
> | Show Version:No
> | Show Help:   No
> | Check Only:  Disabled
> | Stop:False
> | Wait:0
> | Run as service:  No
> | Install service: No
> | Remove service:  No
> | JVM Name:"server"
> | Java Home:   "null"
> | PID File:"/var/run/jsvc.pid"
> | User Name:   "null"
> | Extra Options:   1
> |
> "-Djava.class.path=/Users/thad/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:./target/MultiThread-1.0-SNAPSHOT.jar"
> | Class Invoked:   "com.mindwrap.sample.thread.MultiThread"
> | Class Arguments: 1
> |   "once"
> +---
> Home not specified on command line, using environment
> Home not on command line or in environment, searching
> Attempting to locate Java Home in
> /System/Library/Frameworks/JavaVM.framework/Home
> Attempting to locate VM configuration file
> /System/Library/Frameworks/JavaVM.framework/Home/jre/lib/jvm.cfg
> Attempting to locate VM configuration file
> /System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg
> Found VM configuration file at
> /System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg
> Found VM client definition in configuration
> Checking library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclient.dylib
> Found VM jvm definition in configuration
> Checking library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libjvm.dylib
> Found VM hotspot definition in configuration
> Checking library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libhotspot.dylib
> Found VM server definition in configuration
> Checking library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
> Found VM classic definition in configuration
> Checking library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclassic.dylib
> Cannot locate library for VM classic (skipping)
> Java Home located in /System/Library/Frameworks/JavaVM.framework/Home
> +-- DUMPING JAVA HOME STRUCTURE 
> | Java Home:   "/System/Library/Frameworks/JavaVM.framework/Home"
> | Java VM Config.:
> "/System/Library/Frameworks/JavaVM.framework/Home/lib/jvm.cfg"
> | Found JVMs:  4
> | JVM Name:"client"
> |
>  
> "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libclient.dylib"
> | JVM Name:"jvm"
> |
>  "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libjvm.dylib"
> | JVM Name:"hotspot"
> |
>  
> "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libhotspot.dylib"
> | JVM Name:"server"
> |
>  
> "/System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib"
> +---
> redirecting stdout to /dev/null and stderr to /dev/null
> Switching umask back to 022 from 077
> Using specific JVM in
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
> Attemtping to load library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
> 
> thad@Thads-Mac-mini.local:~/jdevel/MultiThreadTest
> 621 $ JVM library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libserver.dylib
> loaded
> Attemtping to load library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libverify.dylib
> Shell library
> /System/Library/Frameworks/JavaVM.framework/Home/../Libraries/libverify.dylib
> loaded
> JVM library entry point found (0x09E34762)
> +-- DUMPING JAVA VM CREATION ARGUMENTS -
> | Version:   0x010004
> | Ignore Unrecognized Arguments: False
> | Extra options: 1
> |
> "-Djava.class.path=/Users/thad/.m2/repository/commons-daemon/commons-daemon/1.0.15/commons-daemon-1.0.15.jar:./target/MultiThread-1.0-SNAPSHOT.jar"
> (0x)
> +---
> | Internal options:  4
> |   "-Dcommons.daemon.process.id=17848" (0x)
> |   "-Dcommons.daemon.process.parent=17847" (0x)
> |   "-Dcommons.daemon.version=1.0.15-dev" (0x)
> |   "abort" (0x096a6f50)
> +---
> Java VM created successfully
> Class org/apache/commons/daemon/support/DaemonLoader found
> Native methods registered
>

Re: [daemon] Service monitor in taskbar

2013-10-24 Thread kosurusekhar
Hi Darren,

The startup folder what you are checking is per user, Tomcat will register a
register key in Machine level. You can see it run->msconfig->startup tab.

There tomcat will listed as startup process system wide.


Regards
Sekhar.



--
View this message in context: 
http://apache-commons.680414.n4.nabble.com/daemon-Service-monitor-in-taskbar-tp3836963p4655784.html
Sent from the Commons - User mailing list archive at Nabble.com.

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



Re: [DAEMON] Assigning JVM to a core

2013-10-16 Thread Gary Gregory
Nice tips, but it sounds like I am out of luck with telling prunsrv.exe to
set the affinity for a JVM, right?

Gary


On Wed, Oct 16, 2013 at 12:26 PM, Martin Gainty  wrote:

> procaff  /wait 2 notepad.exe starts notepad.exe on CPU 1 synchronously
> procaff  /run  1 notepad.exe starts notepad.exe on CPU 0 asynchronously
> procaff  /set  3 4296 sets processor affinity of process with pid 4296 to 3
> procaff  /set  3 foo.exe sets processor affinity of process "foo.exe"  to 3
>
>
> Vielen Danke Thomas!
> Martin
>
>
>
>
>
>
> > Date: Wed, 16 Oct 2013 17:51:51 +0200
> > Subject: Re: [DAEMON] Assigning JVM to a core
> > From: thomas.neidh...@gmail.com
> > To: user@commons.apache.org
> >
> > This link may help you:
> > http://www.scalabiliti.com/blog/java_jvm_processor_affinity
> >
> >
> > On Wed, Oct 16, 2013 at 4:38 PM, Gary Gregory  >wrote:
> >
> > > Ping?
> > >
> > > On Thu, Oct 10, 2013 at 10:13 PM, Gary Gregory  > > >wrote:
> > >
> > > > On Thu, Oct 10, 2013 at 10:11 PM, Martin Gainty  >
> > > > wrote:
> > > > > Gary
> > > > >
> > > > > which version of os/arch are you targetting?
> > > >
> > > > Martin,
> > > >
> > > > I'm pretty sure our IT folks are looking at Windows 32 and/or 64-bit.
> > > > If it matters I'll get the exact versions.
> > > >
> > > > Gary
> > > >
> > > > >
> > > > > Martin
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >> Date: Thu, 10 Oct 2013 22:08:09 -0400
> > > > >> Subject: [DAEMON] Assigning JVM to a core
> > > > >> From: garydgreg...@gmail.com
> > > > >> To: user@commons.apache.org
> > > > >>
> > > > >> Hi All:
> > > > >>
> > > > >> Is there a way to tell [daemon] to run a JVM on a specific core
> within
> > > > a CPU?
> > > > >>
> > > > >> Gary
> > > > >>
> > > > >> --
> > > > >> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> > > > >> Java Persistence with Hibernate, Second Edition
> > > > >> JUnit in Action, Second Edition
> > > > >> Spring Batch in Action
> > > > >> Blog: http://garygregory.wordpress.com
> > > > >> Home: http://garygregory.com/
> > > > >> Tweet! http://twitter.com/GaryGregory
> > > > >>
> > > > >>
> -
> > > > >> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > > > >> For additional commands, e-mail: user-h...@commons.apache.org
> > > > >>
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> > > > Java Persistence with Hibernate, Second Edition
> > > > JUnit in Action, Second Edition
> > > > Spring Batch in Action
> > > > Blog: http://garygregory.wordpress.com
> > > > Home: http://garygregory.com/
> > > > Tweet! http://twitter.com/GaryGregory
> > > >
> > >
> > >
> > >
> > > --
> > > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> > > Java Persistence with Hibernate, Second Edition<
> > > http://www.manning.com/bauer3/>
> > > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > > Spring Batch in Action <http://www.manning.com/templier/>
> > > Blog: http://garygregory.wordpress.com
> > > Home: http://garygregory.com/
> > > Tweet! http://twitter.com/GaryGregory
> > >
>
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


RE: [DAEMON] Assigning JVM to a core

2013-10-16 Thread Martin Gainty
procaff  /wait 2 notepad.exe starts notepad.exe on CPU 1 synchronously
procaff  /run  1 notepad.exe starts notepad.exe on CPU 0 asynchronously
procaff  /set  3 4296 sets processor affinity of process with pid 4296 to 3
procaff  /set  3 foo.exe sets processor affinity of process "foo.exe"  to 3


Vielen Danke Thomas!
Martin 


  



> Date: Wed, 16 Oct 2013 17:51:51 +0200
> Subject: Re: [DAEMON] Assigning JVM to a core
> From: thomas.neidh...@gmail.com
> To: user@commons.apache.org
> 
> This link may help you:
> http://www.scalabiliti.com/blog/java_jvm_processor_affinity
> 
> 
> On Wed, Oct 16, 2013 at 4:38 PM, Gary Gregory wrote:
> 
> > Ping?
> >
> > On Thu, Oct 10, 2013 at 10:13 PM, Gary Gregory  > >wrote:
> >
> > > On Thu, Oct 10, 2013 at 10:11 PM, Martin Gainty 
> > > wrote:
> > > > Gary
> > > >
> > > > which version of os/arch are you targetting?
> > >
> > > Martin,
> > >
> > > I'm pretty sure our IT folks are looking at Windows 32 and/or 64-bit.
> > > If it matters I'll get the exact versions.
> > >
> > > Gary
> > >
> > > >
> > > > Martin
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >> Date: Thu, 10 Oct 2013 22:08:09 -0400
> > > >> Subject: [DAEMON] Assigning JVM to a core
> > > >> From: garydgreg...@gmail.com
> > > >> To: user@commons.apache.org
> > > >>
> > > >> Hi All:
> > > >>
> > > >> Is there a way to tell [daemon] to run a JVM on a specific core within
> > > a CPU?
> > > >>
> > > >> Gary
> > > >>
> > > >> --
> > > >> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> > > >> Java Persistence with Hibernate, Second Edition
> > > >> JUnit in Action, Second Edition
> > > >> Spring Batch in Action
> > > >> Blog: http://garygregory.wordpress.com
> > > >> Home: http://garygregory.com/
> > > >> Tweet! http://twitter.com/GaryGregory
> > > >>
> > > >> -
> > > >> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > > >> For additional commands, e-mail: user-h...@commons.apache.org
> > > >>
> > > >
> > >
> > >
> > >
> > > --
> > > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> > > Java Persistence with Hibernate, Second Edition
> > > JUnit in Action, Second Edition
> > > Spring Batch in Action
> > > Blog: http://garygregory.wordpress.com
> > > Home: http://garygregory.com/
> > > Tweet! http://twitter.com/GaryGregory
> > >
> >
> >
> >
> > --
> > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> > Java Persistence with Hibernate, Second Edition<
> > http://www.manning.com/bauer3/>
> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > Spring Batch in Action <http://www.manning.com/templier/>
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
> >
  

Re: [DAEMON] Assigning JVM to a core

2013-10-16 Thread Thomas Neidhart
This link may help you:
http://www.scalabiliti.com/blog/java_jvm_processor_affinity


On Wed, Oct 16, 2013 at 4:38 PM, Gary Gregory wrote:

> Ping?
>
> On Thu, Oct 10, 2013 at 10:13 PM, Gary Gregory  >wrote:
>
> > On Thu, Oct 10, 2013 at 10:11 PM, Martin Gainty 
> > wrote:
> > > Gary
> > >
> > > which version of os/arch are you targetting?
> >
> > Martin,
> >
> > I'm pretty sure our IT folks are looking at Windows 32 and/or 64-bit.
> > If it matters I'll get the exact versions.
> >
> > Gary
> >
> > >
> > > Martin
> > >
> > >
> > >
> > >
> > >
> > >> Date: Thu, 10 Oct 2013 22:08:09 -0400
> > >> Subject: [DAEMON] Assigning JVM to a core
> > >> From: garydgreg...@gmail.com
> > >> To: user@commons.apache.org
> > >>
> > >> Hi All:
> > >>
> > >> Is there a way to tell [daemon] to run a JVM on a specific core within
> > a CPU?
> > >>
> > >> Gary
> > >>
> > >> --
> > >> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> > >> Java Persistence with Hibernate, Second Edition
> > >> JUnit in Action, Second Edition
> > >> Spring Batch in Action
> > >> Blog: http://garygregory.wordpress.com
> > >> Home: http://garygregory.com/
> > >> Tweet! http://twitter.com/GaryGregory
> > >>
> > >> -
> > >> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> > >> For additional commands, e-mail: user-h...@commons.apache.org
> > >>
> > >
> >
> >
> >
> > --
> > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> > Java Persistence with Hibernate, Second Edition
> > JUnit in Action, Second Edition
> > Spring Batch in Action
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
> >
>
>
>
> --
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> Java Persistence with Hibernate, Second Edition<
> http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition 
> Spring Batch in Action 
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>


Re: [DAEMON] Assigning JVM to a core

2013-10-16 Thread Gary Gregory
Ping?

On Thu, Oct 10, 2013 at 10:13 PM, Gary Gregory wrote:

> On Thu, Oct 10, 2013 at 10:11 PM, Martin Gainty 
> wrote:
> > Gary
> >
> > which version of os/arch are you targetting?
>
> Martin,
>
> I'm pretty sure our IT folks are looking at Windows 32 and/or 64-bit.
> If it matters I'll get the exact versions.
>
> Gary
>
> >
> > Martin
> >
> >
> >
> >
> >
> >> Date: Thu, 10 Oct 2013 22:08:09 -0400
> >> Subject: [DAEMON] Assigning JVM to a core
> >> From: garydgreg...@gmail.com
> >> To: user@commons.apache.org
> >>
> >> Hi All:
> >>
> >> Is there a way to tell [daemon] to run a JVM on a specific core within
> a CPU?
> >>
> >> Gary
> >>
> >> --
> >> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> >> Java Persistence with Hibernate, Second Edition
> >> JUnit in Action, Second Edition
> >> Spring Batch in Action
> >> Blog: http://garygregory.wordpress.com
> >> Home: http://garygregory.com/
> >> Tweet! http://twitter.com/GaryGregory
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> >> For additional commands, e-mail: user-h...@commons.apache.org
> >>
> >
>
>
>
> --
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition
JUnit in Action, Second Edition 
Spring Batch in Action 
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


Re: [DAEMON] Assigning JVM to a core

2013-10-10 Thread Gary Gregory
On Thu, Oct 10, 2013 at 10:11 PM, Martin Gainty  wrote:
> Gary
>
> which version of os/arch are you targetting?

Martin,

I'm pretty sure our IT folks are looking at Windows 32 and/or 64-bit.
If it matters I'll get the exact versions.

Gary

>
> Martin
>
>
>
>
>
>> Date: Thu, 10 Oct 2013 22:08:09 -0400
>> Subject: [DAEMON] Assigning JVM to a core
>> From: garydgreg...@gmail.com
>> To: user@commons.apache.org
>>
>> Hi All:
>>
>> Is there a way to tell [daemon] to run a JVM on a specific core within a CPU?
>>
>> Gary
>>
>> --
>> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
>> Java Persistence with Hibernate, Second Edition
>> JUnit in Action, Second Edition
>> Spring Batch in Action
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition
JUnit in Action, Second Edition
Spring Batch in Action
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

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



RE: [DAEMON] Assigning JVM to a core

2013-10-10 Thread Martin Gainty
Gary

which version of os/arch are you targetting?

Martin 


  


> Date: Thu, 10 Oct 2013 22:08:09 -0400
> Subject: [DAEMON] Assigning JVM to a core
> From: garydgreg...@gmail.com
> To: user@commons.apache.org
> 
> Hi All:
> 
> Is there a way to tell [daemon] to run a JVM on a specific core within a CPU?
> 
> Gary
> 
> -- 
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 
  

Re: [daemon] Java Service stop acting differently on different machines

2013-08-20 Thread Andrew Miller
A follow-up to this... we discovered that if we re-wrote the Service to
have the start method block until the stop method is called, the Service is
stopped cleanly on the machines that displayed the 1067 error code
previously.  I know the main documentation page says that if you use the
jvm mode this is the proper way to code the Service to work, but the
Service appeared to work fine without blocking on all the machines on which
we did the early development on, so we figured we could get away without
implementing the block.  Still, would be curious to determine what's
different on the machines where the shutdown failure occurs.  We deploy
with a common JRE instance so I would think this may be Windows
configuration difference.

-- 
"There ain't much to being a ballplayer, if you're a ballplayer." -- Honus
Wagner


Re: [daemon] Java Service stop acting differently on different machines

2013-08-19 Thread Mladen Turk

On 08/19/2013 05:11 PM, Andrew Miller wrote:


(".."\java_error_%p.txt) (passed in via the JvmOptions parameter when
the service is installed) and we aren't seeing any logs generated.  Is the
%p construct handled by Procrun?



Nope.


Regards
--
^TM

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



Re: [daemon] Java Service stop acting differently on different machines

2013-08-19 Thread Andrew Miller
Sebb gets to the heart of the matter... thanks! :)

Our service code is actually making use of 0/[nonzero] return codes to
signal to Windows on whether or not Windows should restart the Service.
What we found in a general case (except on these certain machines) is that
if a user directs to Service to stop (via the Services GUI or command line
sc command), the Service stops and doesn't restart no matter what the
return value is and how the Windows Service Recovery Options are
configured, so we didn't spend much time coding how to return 0 when a
directed stop occurs versus unexpected shutdowns/failures because of
certain fatal exceptions.  So in the case documented in this thread, we are
indeed returning an exit code of 1 intentionally.  Of course, as sebb
pointed out, on certain machines we aren't seeing the exit hook invoked,
which Windows interprets as an unexpected stop of the service and thus
invokes the Recovery Options (which is, in our case is always to restart,
no matter how many recent failures have occurred).

Our service apps are also configured to generate error log files in a well
known directory via the -XX:ErrorFile parameter
(".."\java_error_%p.txt) (passed in via the JvmOptions parameter when
the service is installed) and we aren't seeing any logs generated.  Is the
%p construct handled by Procrun?


Re: [daemon] Java Service stop acting differently on different machines

2013-08-19 Thread sebb
On 19 August 2013 10:17, Mladen Turk  wrote:
> On 08/19/2013 12:53 AM, Andrew Miller wrote:
>>
>> Seems like the JVM is
>> crashing, which leads Windows
>
>
> If the JVM crashes you should have jvm's generated crash log file.
> Doubt that is the reason.
>
> What you have in log file is
>
> ( javajni.c:471 ) [ 6948] Exit hook with exit code 1
>
>
> This means that your java code exit hook has returned non zero value.
> Check your java code for return values from main(). In case non zero
> is returned as exit code service will never be reported as stopped.

But why is the exit hook apparently not invoked?
The following 4 lines are missing from the failing system (timestamps
omitted to reduce likelihood of line-wrap):

[debug] ( prunsrv.c:910 ) [ 7452] Stop exit hook called ...
[debug] ( prunsrv.c:844 ) [ 7452] reportServiceStatusE: 1, 0, 0, 0
[debug] ( prunsrv.c:919 ) [ 7452] Start exit hook called ...
[debug] ( prunsrv.c:920 ) [ 7452] VM exit code: 1

>
> Regards
> --
> ^TM
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [daemon] Java Service stop acting differently on different machines

2013-08-19 Thread Mladen Turk

On 08/19/2013 12:53 AM, Andrew Miller wrote:

Seems like the JVM is
crashing, which leads Windows


If the JVM crashes you should have jvm's generated crash log file.
Doubt that is the reason.

What you have in log file is
( javajni.c:471 ) [ 6948] Exit hook with exit code 1


This means that your java code exit hook has returned non zero value.
Check your java code for return values from main(). In case non zero
is returned as exit code service will never be reported as stopped.


Regards
--
^TM

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



Re: [daemon] Issue DAEMON-281

2013-07-06 Thread Benedikt Ritter
It would probably bet better to move this to the dev ML to get more
feedback.

Benedikt


2013/7/5 Ian Emmons 

> Ping?
>
>
> On May 4, 2013, at 3:59 PM, Ian Emmons  wrote:
> > I re-opened this issue because the previous fix didn't work.  I also
> attached a patch to the issue that (I believe) fixes it correctly.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter


  1   2   3   >