Run PMS as a service

For help and support with PS3 Media Server in general
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

Re: Run PMS as a service

Postby KwaXi » Tue Feb 07, 2012 1:54 pm

I've described an easy way setting up a windows service for PMS. This way you can configure jvm and other options.

http://www.ps3mediaserver.org/forum/viewtopic.php?f=6&t=13102
KwaXi
 
Posts: 8
Joined: Thu Dec 29, 2011 2:14 pm

Re: Run PMS as a service

Postby Occ » Sun Apr 15, 2012 5:12 am

Had to register just to thank the OP. Tried to install as service, didn't work. The service was there and started, but my 360 wasn't seeing it. Uninstalled the service, followed the steps here, works like a charm now.
Occ
 
Posts: 1
Joined: Sun Apr 15, 2012 5:09 am

Re: Run PMS as a service

Postby Mickski » Thu Nov 08, 2012 3:48 am

For unknown reason, starting PMS as a service no more works whereas it was working before... but before what, I don't know !

I'm running it under Windows 7 pro.

The wrapper.log contents the following :
Code: Select all
DEBUG  | wrapper  | 2012/11/08 03:13:06 | Allocating a console for the service.
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Found console window.
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Wrapper console window hidden successfully.
STATUS | wrapper  | 2012/11/08 03:13:07 | --> Wrapper Started as Service
STATUS | wrapper  | 2012/11/08 03:13:07 | Java Service Wrapper Community Edition 32-bit 3.5.9
STATUS | wrapper  | 2012/11/08 03:13:07 |   Copyright (C) 1999-2011 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper  | 2012/11/08 03:13:07 |     http://wrapper.tanukisoftware.com
STATUS | wrapper  | 2012/11/08 03:13:07 |
DEBUG  | wrapper  | 2012/11/08 03:13:07 | The file "C:\Program Files (x86)\PS3 Media Server\win32\service\wrapper.exe" is signed and the signature was verified.
DEBUG  | wrapper  | 2012/11/08 03:13:07 |   Signer Certificate:
DEBUG  | wrapper  | 2012/11/08 03:13:07 |     Serial Number:
DEBUG  | wrapper  | 2012/11/08 03:13:07 |       00 97 06 fe b5 6e 56 cc cb 66 3a bb 55 a7 a0 e4 76
DEBUG  | wrapper  | 2012/11/08 03:13:07 |     Issuer Name: UTN-USERFirst-Object
DEBUG  | wrapper  | 2012/11/08 03:13:07 |     Subject Name: Tanuki Software Ltd.
DEBUG  | wrapper  | 2012/11/08 03:13:07 |   TimeStamp Certificate:
DEBUG  | wrapper  | 2012/11/08 03:13:07 |     Serial Number:
DEBUG  | wrapper  | 2012/11/08 03:13:07 |       47 8a 8e fb 59 e1 d8 3f 0c e1 42 d2 a2 87 07 be
DEBUG  | wrapper  | 2012/11/08 03:13:07 |     Issuer Name: UTN-USERFirst-Object
DEBUG  | wrapper  | 2012/11/08 03:13:07 |     Subject Name: COMODO Time Stamping Signer
DEBUG  | wrapper  | 2012/11/08 03:13:07 |     Date of TimeStamp : 2011/05/09 09:37
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Release time: 2011/05/09 00:00:00
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Build time:   2011/05/09 18:36:00
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Timezone:     Paris, Madrid (Paris, Madrid (heure dÆÚtÚ)) Offset: -3600, hasDaylight: 1
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Using tick timer.
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Current User: Système  Domain: AUTORITE NT
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Operating System ID: Microsoft Windows 7 Ultimate Edition Service Pack 1 (build 7601), 64-bit
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Use tick timer mutex=FALSE
DEBUG  | wrapper  | 2012/11/08 03:13:07 | active log file changed: win32\service\wrapper.log
DEBUG  | wrapperp | 2012/11/08 03:13:07 | server listening on port 32000.
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Ping settings: wrapper.ping.interval=5, wrapper.ping.interval.logged=1, wrapper.ping.timeout=30
STATUS | wrapper  | 2012/11/08 03:13:07 | Launching a JVM...
DEBUG  | wrapper  | 2012/11/08 03:13:07 | Command: "java" -Djava.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dstart.service=true -Xmx1536m -Djava.library.path="win32/service/" -classpath "win32/service/wrapper.jar;pms.jar" -Dwrapper.key="-_AjMBHB4kVff6yO" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=2112 -Dwrapper.version="3.5.9" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp net.pms.PMS
FATAL  | wrapper  | 2012/11/08 03:13:07 |     Unable to execute Java command.  Le fichier spécifié est introuvable. (0x2)
FATAL  | wrapper  | 2012/11/08 03:13:07 |     "java" -Djava.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dstart.service=true -Xmx1536m -Djava.library.path="win32/service/" -classpath "win32/service/wrapper.jar;pms.jar" -Dwrapper.key="-_AjMBHB4kVff6yO" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=2112 -Dwrapper.version="3.5.9" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp net.pms.PMS
ADVICE | wrapper  | 2012/11/08 03:13:07 |
ADVICE | wrapper  | 2012/11/08 03:13:07 | --------------------------------------------------------------------
ADVICE | wrapper  | 2012/11/08 03:13:07 | Advice:
ADVICE | wrapper  | 2012/11/08 03:13:07 | Usually when the Wrapper fails to start the JVM process, it is
ADVICE | wrapper  | 2012/11/08 03:13:07 | because of a problem with the value of the configured Java command.
ADVICE | wrapper  | 2012/11/08 03:13:07 | Currently:
ADVICE | wrapper  | 2012/11/08 03:13:07 | wrapper.java.command=java
ADVICE | wrapper  | 2012/11/08 03:13:07 | Please make sure that the PATH or any other referenced environment
ADVICE | wrapper  | 2012/11/08 03:13:07 | variables are correctly defined for the current environment.
ADVICE | wrapper  | 2012/11/08 03:13:07 | --------------------------------------------------------------------
ADVICE | wrapper  | 2012/11/08 03:13:07 |
FATAL  | wrapper  | 2012/11/08 03:13:07 | Critical error: wait for JVM process failed


From "MS-DOS" console, running "java -version" works fine :
Code: Select all
C:\Users\Mickski>java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)


Copying the java command from the wrapper.log above into the MS-DOS console,
Code: Select all
C:\Users\Mickski>java -Djava.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dstart.service=true -Xmx1536m -Djava.librar
y.path="win32/service/" -classpath "win32/service/wrapper.jar;pms.jar" -Dwrapper.key="-_AjMBHB4kVff6yO" -Dwrapper.port=3
2000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=2112 -Dwrapper.versi
on="3.5.9" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.
tanukisoftware.wrapper.WrapperSimpleApp net.pms.PMS

I get the following message :
Code: Select all
Erreur : impossible de trouver ou charger la classe principale org.tanukisoftware.wrapper.WrapperSimpleApp
(Error : unable to find or load the main class org.tanukisoftware.wrapper.WrapperSimpleApp)


Furthermore, when I try to start the PMS Service from Service Control Panel, the following popup appears :
Image

Note that the PMS runs and works fine if manually launched from the Desktop. It is only the service startup that fails.

More details of my system from debug.log :
Code: Select all
INFO  2012-11-08 03:10:11.783 [main] Starting PS3 Media Server 1.71.0
INFO  2012-11-08 03:10:11.833 [main] by shagrath / 2008-2012
INFO  2012-11-08 03:10:11.843 [main] http://ps3mediaserver.org
INFO  2012-11-08 03:10:11.853 [main] https://github.com/ps3mediaserver/ps3mediaserver
INFO  2012-11-08 03:10:11.853 [main]
INFO  2012-11-08 03:10:11.853 [main] Build: d4d1de9d0 (2012-11-06)
INFO  2012-11-08 03:10:11.863 [main] Java: 1.7.0-Oracle Corporation
INFO  2012-11-08 03:10:11.873 [main] OS: Windows 7 amd64 6.1
INFO  2012-11-08 03:10:11.873 [main] Encoding: Cp1252
INFO  2012-11-08 03:10:11.873 [main] Memory: 1763 MB
INFO  2012-11-08 03:10:11.873 [main]
INFO  2012-11-08 03:10:11.873 [main] Working directory: C:\Program Files (x86)\PS3 Media Server
INFO  2012-11-08 03:10:11.903 [main] Temp directory: C:\Users\Mickski\AppData\Local\Temp\ps3mediaserver
INFO  2012-11-08 03:10:11.913 [main] Logging config file: C:\Program Files (x86)\PS3 Media Server\logback.xml
INFO  2012-11-08 03:10:11.913 [main] debug.log: C:\Program Files (x86)\PS3 Media Server\debug.log
INFO  2012-11-08 03:10:11.913 [main]
INFO  2012-11-08 03:10:11.913 [main] Profile directory: C:\ProgramData\PMS
INFO  2012-11-08 03:10:11.913 [main] Profile path: C:\ProgramData\PMS\PMS.conf
INFO  2012-11-08 03:10:11.913 [main] Profile permissions: rw
INFO  2012-11-08 03:10:11.913 [main] Profile name: EscoubarotW7


Of course, I've already tried to uninstall / install both PMS and JRE without any result.
Any idea is welcome to help me solve this issue !
Mickski
 
Posts: 5
Joined: Thu Nov 08, 2012 3:24 am

Re: Run PMS as a service

Postby meskibob » Thu Nov 08, 2012 4:37 am

Given that "java -version" works, it sounds like a firewall is blocking wrapper.exe. What happens when you start the service after disabling all firewalls?
I provide NO application support via PM or email, so please post your question to the forum per the Forum Rules.
meskibob
Moderator
 
Posts: 4738
Joined: Mon Jan 19, 2009 4:11 pm

Re: Run PMS as a service

Postby KwaXi » Thu Nov 08, 2012 7:48 am

Given the following output:
Mickski wrote:[...]
From "MS-DOS" console, running "java -version" works fine :
Code: Select all
C:\Users\Mickski>java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
[...]

I think that it's possible that the TanukiSoft Java Service Wrapper tries to use a 64-bit JVM. Unfortunately this wrapper isn't 64-bit aware in it's free edition. Can you try using a 32-bit bit JVM my previously posted approach using an other Java Service Wrapper?
KwaXi
 
Posts: 8
Joined: Thu Dec 29, 2011 2:14 pm

Re: Run PMS as a service

Postby meskibob » Thu Nov 08, 2012 1:08 pm

I didn't even think about the java version of the wrapper. Thank you for the more in depth and probably correct response. :)
I provide NO application support via PM or email, so please post your question to the forum per the Forum Rules.
meskibob
Moderator
 
Posts: 4738
Joined: Mon Jan 19, 2009 4:11 pm

Re: Run PMS as a service

Postby Mickski » Thu Nov 08, 2012 1:15 pm

meskibob wrote:Given that "java -version" works, it sounds like a firewall is blocking wrapper.exe. What happens when you start the service after disabling all firewalls?

I assume that no firewall is running as I fully deactivated the one built-in in Windows and I never installed a third-party firewall.
I will have a check anyway, thanks.


KwaXi wrote:Given the following output:
Mickski wrote:[...]
From "MS-DOS" console, running "java -version" works fine :
Code: Select all
C:\Users\Mickski>java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
[...]

I think that it's possible that the TanukiSoft Java Service Wrapper tries to use a 64-bit JVM. Unfortunately this wrapper isn't 64-bit aware in it's free edition. Can you try using a 32-bit bit JVM my previously posted approach using an other Java Service Wrapper?

I already tried to run the command by adding the parameter -d32 through the wrapper.conf without any result.

Anyway, I will try to replace my current JVM by a 32-bit version to test.

Thanx for suggestions. ;)
Mickski
 
Posts: 5
Joined: Thu Nov 08, 2012 3:24 am

Re: Run PMS as a service

Postby KwaXi » Thu Nov 08, 2012 1:25 pm

Mickski wrote:I already tried to run the command by adding the parameter -d32 through the wrapper.conf without any result.

Anyway, I will try to replace my current JVM by a 32-bit version to test.

Thanx for suggestions. ;)

I tried JVM parameter -d32 but it still runs the 64-bit binary. From my perspective the save way is to either explicitly specify the used installation folder or jvm.dll. This behavior is described at http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#64bit_selection
KwaXi
 
Posts: 8
Joined: Thu Dec 29, 2011 2:14 pm

Re: Run PMS as a service

Postby Mickski » Thu Nov 08, 2012 1:36 pm

KwaXi wrote:
Mickski wrote:I already tried to run the command by adding the parameter -d32 through the wrapper.conf without any result.

Anyway, I will try to replace my current JVM by a 32-bit version to test.

Thanx for suggestions. ;)

I tried JVM parameter -d32 but it still runs the 64-bit binary. From my perspective the save way is to either explicitly specify the used installation folder or jvm.dll. This behavior is described at http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#64bit_selection

Sounds interesting but I also already tried to set my aboslute path into wrapper.conf by replacing
Code: Select all
wrapper.working.dir=../../

by
Code: Select all
wrapper.working.dir=C:\Program Files (x86)\PS3 Media Server


and nothing changes.

Well, I will continue looking this direction for any solution.
Mickski
 
Posts: 5
Joined: Thu Nov 08, 2012 3:24 am

Re: Run PMS as a service

Postby KwaXi » Thu Nov 08, 2012 2:43 pm

I meant the path to the Java Runtime in use, not to the PMS installation.
KwaXi
 
Posts: 8
Joined: Thu Dec 29, 2011 2:14 pm

PreviousNext

Return to General Help and Support

Who is online

Users browsing this forum: geb724, Yahoo [Bot] and 26 guests