trinidad_init_service and prunsrv --Classpath argument

89 views
Skip to first unread message

KenD

unread,
Dec 3, 2012, 3:58:56 PM12/3/12
to rails-t...@googlegroups.com
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)?

Thanks,
Ken

Tim Olsen

unread,
Dec 3, 2012, 4:11:40 PM12/3/12
to rails-t...@googlegroups.com
I needed the something similar, so I added support for a TRINIDAD_EXTRA_CLASSPATH environment variable on my own fork of trinidad_init_services: https://github.com/tolsen/trinidad_init_services/commit/44c7304c15f95cc5696d1eeea5fbee7281fb0c21

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

Tim



--
Has recibido este mensaje porque estás suscrito al grupo "Rails Trinidad" de Grupos de Google.
Para ver este debate en la Web, visita https://groups.google.com/d/msg/rails-trinidad/-/HGF-MIcmzHQJ.
Para publicar una entrada en este grupo, envía un correo electrónico a rails-t...@googlegroups.com.
Para anular tu suscripción a este grupo, envía un correo electrónico a rails-trinida...@googlegroups.com
Para tener acceso a más opciones, visita el grupo en http://groups.google.com/group/rails-trinidad?hl=es.

kares

unread,
Dec 5, 2012, 2:52:17 AM12/5/12
to rails-t...@googlegroups.com

 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.

K.

KenD

unread,
Dec 5, 2012, 6:55:37 PM12/5/12
to rails-t...@googlegroups.com
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:

--Classpath=%JRUBY_HOME_BACKSLASH%\lib\ruby\gems\1.8\gems\trinidad_init_services-1.2.1\trinidad-libs\jruby-jsvc.jar;%JRUBY_HOME_BACKSLASH%\lib\ruby\gems\1.8\gems\trinidad_init_services-1.2.1\trinidad-libs\commons-daemon.jar;%JRUBY_HOME_BACKSLASH%\lib\jruby.jar;%APP_DIR_BACKSLASH%\lib\sqljdbc4.jar

kares

unread,
Dec 6, 2012, 1:51:52 AM12/6/12
to rails-t...@googlegroups.com

 Thanks Ken, could you copy this to an issue at https://github.com/trinidad/trinidad_init_services/issues (OR also welcome :))

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

K.
Reply all
Reply to author
Forward
0 new messages