Alternative Percussion startup/service installation scripts


I have configured an open source Java Service Wrapper to work with CM System. This is simple to install and can work as a direct replacement to our current service/deamon installation and startup binaries. This provides us numerous benefits, and has many configuration options.

original package is found here

This provides the following benfits
[li]No more errors when Rhythmyx is restarted before it is stop. this guarantees one instance.
[/li][li]Errors, e.g memory usage (heap) over a certain percentage of maximum or particular text in the log can automatically trigger restart, email, and/or script to be run.
[/li][li]Process thread deadlock can be detected and a dump of the offending threads is thrown.
[/li][li]Java process is pinged and if it takes too long to respond, or there has been no log messages for a long time, we can assume a problem and can trigger an email/restart
[/li][li]JMX can be configured, this allows connection to the wrapper remotely (you can use jconsole that comes with the Java JDK) and reports on the memory/thread and other status information, as well as enabling remote triggering or Percussion start/stop. This would be nice to integrate into HHS,
[/li][li]On windows a taskbar icon, providing status information, exception notification and start/stop as well as a console log, (even percussion icon)
[/li][li]More complex functionality can be easily scripted in using groovy scripts
[/li][li]Provides ability to remove the registered windows service.
[/li][li]Could be scripted, use java api within the cm system install process to register and configure the service automatically.
[/li][li]Set CPU and process affinity of CM System.
[/li][li]Pure Java, no native C code or creation of binaries for each platform.

I have created a configuration that is included in this post. To make use of this all you have to do is drop in the wrapper folder in the rhythmyx root. It is pre-configured to look for the java binaries and jar files relative to this location. The main wrapper.conf has been configured as well as well as setenv.bat and modified to point at the JRE in the Rhythmyx install, everything else is as original. The only installation required for this is to drop the wrapper folder in the Rhythmyx root and it should work on windows and unix.

Configuration file is in wrapper/conf/wrapper.conf (Xmx setting for memory would be used from this file now. RhythmyxServer.bin.lax would not be used)

Running on windows.

Startup as a console app

As well as starting rhythmyx this adds a task bar icon allowing you to start and stop, as well as opening up a console app. We can even configure it with a percussion icon. As well as showing log the console app shows current cpu, memory and thread state, as well as allowing a thread dump to be done.

To install as a windows service just run (Service name is in configuration file, set as RX Service at the moment, but we could use the existing name and it could replace our existing service registration. ) be careful not to change the service name information before uninstalling the service or it will not be able to remove the service registration. If you want to change this, unistall the service then reinstall after the change.
On Vista, Windows7 service installation scripts will need to be run as Administrator. Make sure you stop the regular percussion service first.

to uninstall service

You can start the service from within windows services or (service name and description set in .conf file
to stop

When running as a service you can call wrapper/bat/systemTrayIcon.bat to get the system tray and console.

I have configured the service so that the service wrapper stays open even when rhythmyx is shut down. This allows us to easily start and stop percussion using the system tray icon, or using JMX (remote start and stop of percussion) or even scheduling rhythmyx to be started and stopped. The wrapper can be easily be changed so the wrapper shuts down as well. Java RMI that the jmx uses by default can be tricky to pass through firewalls though

Connect with jmx using java jconsole with url service:jmx:rmi///jndi/rmi://{server}:1099/server
go to
org.rzo.jajsw/Percussion Rhythmyx/Operration and you can click on start / stop
information is in
org.rzo.jajsw/Percussion Rhythmyx/Attributes if you click on a value that changes e.g. AppCpu it will open up a live chart.

Running on unix works in the same way. the task bar icon does not apply of course, instead of installService and uninstallService use and use sudo or root to install/uninstall the Daemon and to start/stop the daemon. The configuration sets the user name that will be changed to to actually run, default is Rhythmyx

Drop this in and test this out, tell me what you think. Also I would be interested if anyone manages to improve the configuration, any handy scripts or features etc

Just a note on this. Tech support will not currently yet be able to help out with any issues you have with this, if you have any issues with configuration or usage you can try posting to this thread or trying the yajsw documentation. If you have any other issues with Startup you may want to remove any installed daemon or service and processes installed with this and try with the regular scripts before contacting support.

Thanks for sharing this. I suspect a lot of folks will find this helpful. Unfortunately for me, all of this sort of thing is managed by the sysadmins of our client, so we don’t have access to do this sort of stuff.