prunsrv.exe Service not starting up

2020-06-08 13:37发布

I am trying to install and start a service with prunsrv.exe for an application

I am able to install the service alright but the service wont start up and gives me an error

enter image description here

Also following is the configuration that is used to install the service using prunsrv.exe

set SERVICE_NAME=TestService

REM Service log configuration
set PR_LOGPREFIX=%SERVICE_NAME%
set PR_LOGPATH=D:\setups\Commons_Daemon\commons-daemon-1.0.14-bin-windows\logs
set PR_STDOUTPUT=auto
set PR_STDERROR=auto
set PR_LOGLEVEL=INFO

REM Path to java installation
set PR_JVM=C:\Program Files\Java\jre1.6.0_04\bin\client\jvm.dll
set PR_CLASSPATH=D:\setups\Commons_Daemon\commons-daemon-1.0.14-bin-windows\temp.jar;

REM Startup configuration
set PR_STARTUP=auto
set PR_STARTMODE=java
set PR_STARTCLASS=Trys.AppLauncher
set PR_STARTMETHOD=start

REM Shutdown configuration
set PR_STOPMODE=java
set PR_STOPCLASS=Trys.AppLauncher
set PR_STOPMETHOD=stop

REM JVM configuration
set PR_JVMMS=64
set PR_JVMMX=128
set PR_JVMSS=4000

REM Install service
prunsrv.exe //IS//%SERVICE_NAME%

The above config is packaged to a batch file is executed to install the service

Also the log files are not generated, due which i cant even debug.

Please tell me where i am going wrong

9条回答
手持菜刀,她持情操
2楼-- · 2020-06-08 13:52

In case someone find it helpful. I had the same issue "The data area passed to a system call is too small". This is because program cannot find jvm.dll in StartMode=jvm.

Solution: all depends on your StartMode. 1) if "--StartMode" is jvm you have to specify "--jvm" parameter as path to jvm.dll 2) if "--StartMode" is java or exe set "--jvm" parameter as auto (your program will be launched as separate procces named java.exe)

查看更多
狗以群分
3楼-- · 2020-06-08 13:53

one possible issue is using wrong prunsvr.exe. for 64 bit java install, use amd64/prunsvr.exe, for 32 bit java install, use /prunsvr.exe in commons-deamon-xxx-bin-windows.zip file.

查看更多
仙女界的扛把子
4楼-- · 2020-06-08 13:54

The reason for this error was that i did not rename prunsrv.exe to TestService.exe. Similarly Prunmgr.exe has to be TestServicew.exe.

Very important that these files are renamed.

查看更多
相关推荐>>
5楼-- · 2020-06-08 13:55

I had the same issue in my laptop but it was working on others laptop which is having the same configution.

I have checked %SystemRoot%\System32\LogFiles\Apache\commons-daemon.log. I found the following error missing Image File,

Then I found that we need to put double quotes over all the parameters. On your example, If you try

pushd %CD%

Try this below.

"prunsrv.exe" //IS//%SERVICE_NAME% --Startup="%PR_STARTUP%" --Jvm="%PR_JVM%" --Classpath="%PR_CLASSPATH%" --StartMode="jvm" --StopMode="jvm" --StartClass="%PR_STARTCLASS%" --StartMethod="%PR_STARTMETHOD%" --StopClass="%PR_STOPCLASS%" --StopMethod="%PR_STOPMETHOD%"

SAMPLE EXAMPLE http://www.eclipse.org/jetty/documentation/current/startup-windows-service.html

查看更多
混吃等死
6楼-- · 2020-06-08 13:57

This could be many things. First check the logs. The default is at...

%SystemRoot%\System32\LogFiles\Apache

From there you should be able to get a more specific error. E.g. Classpath, Java path, or some other option being invalid.

查看更多
叛逆
7楼-- · 2020-06-08 13:59

Just compared this with a setup script of mine, the only immediate thing i see is that you should perhaps make your memory settings look like

REM JVM configuration
set PR_JVMMS=64m 
set PR_JVMMX=128m
set PR_JVMSS=128m

And by the way, JRE 1.6.0_04 is somewhat err outdated...

HTH Gyro

查看更多
登录 后发表回答