trinidad_init_service and prunsrv --Classpath argument

Skip to first unread message


Dec 3, 2012, 3:58:56 PM12/3/12
I needed an easy way for a client to install a ruby web app as a Windows service. I went with trinidad and trinidad_init_service and with some effort it is working. I had to go the extra mile with trinidad_init_service and write a script to configure many of the options that are not handled in the configuration prompts.  The script builds the trinidad_init_defaults.yml, runs the trinidad_init_service command, and then runs a bunch of prunsrv commands to truly finish the install (--Jvm, --LogPath, --Classpath) so it runs, and runs properly.

It works, but I needed to extend the classpath to include a jar, and that got ugly.  The only way I could do this succesfully was to use '--Classpath' argument to include all of the jars it was using in trinidad_init_services-1.2.1\trinidad-libs\, the jruby jar, and then my jar.  I tried instead to use --java_lib ./lib in the trinidad args, but that did not work when running as a service.  Is there a better way to specify an additional jar? Or for that matter, any of this (my prunsrv commands)?


Tim Olsen

Dec 3, 2012, 4:11:40 PM12/3/12
I needed the something similar, so I added support for a TRINIDAD_EXTRA_CLASSPATH environment variable on my own fork of trinidad_init_services:

Would you be able to specify an environment variable (or the Windows equivalent) for the service?


Has recibido este mensaje porque estás suscrito al grupo "Rails Trinidad" de Grupos de Google.
Para ver este debate en la Web, visita
Para publicar una entrada en este grupo, envía un correo electrónico a
Para anular tu suscripción a este grupo, envía un correo electrónico a
Para tener acceso a más opciones, visita el grupo en


Dec 5, 2012, 2:52:17 AM12/5/12

 Hi Ken, I'm sorry to here that - trinidad_init_services definitely ain't perfect, cause it's mostly done by windows amateurs such as myself ...

Thus it's as good as power-windows users make it :) ... What did you need to specify that ain't in the prompts, maybe we can work on that to be handled with switches ?
Truly finish the install, forget my limited knowledge but how/why was the installation not complete - what else is needed (it seemed pretty complete for me last time I checked).

An additional jar to be specified - well it depends if it's for the application to consume classes from the jar --java_lib should have worked, you might want to try putting it into your application's [APP_ROOT]/lib/java directory.



Dec 5, 2012, 6:55:37 PM12/5/12
Kares, I'll admit this is challenging stuff on windows, but it would be helpful to have config for the following that I currently set via prunsrv:
--LogPath %APP_DIR%/log
--LogLevel debug
--Startup auto
--ServiceUser .\Administrator
--ServicePassword *******
 --Jvm %JRUBY_HOME%/jre/bin/server/jvm.dll

This is where I wish I could just add sqljdbc4.jar easily:



Dec 6, 2012, 1:51:52 AM12/6/12

 Thanks Ken, could you copy this to an issue at (OR also welcome :))

So we decide this as a (kind of advanced Windows only) feature request ...

Reply all
Reply to author
0 new messages