Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to start WAS Liberty as a Windows service for CLM 6.0.1?

WAS Liberty has replaced Apache Tomcat as the out of the box application server. It was well documented how to start Tomcat as a Windows service. There is no equivalent documentation for WAS Liberty. Searching Google has not returned any useful results.

Has anyone figured out how to do this?

1

0 votes


Accepted answer

Permanent link
Just to add more more information to Shubjit's answer.

There is already a RFE for Liberty fo running it as a Windows service: https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=29865

As Shubjit pointed out, using Apache Commons Daemon is an option. Here is what I did to create the service using Apache Commons Daemon to run CLM 601 in Liberty, I hope it helps:

1. Download the binaries for Windows from http://www.apache.org/dist/commons/daemon/binaries/windows/
2. Unzip the downloaded file
3. Run the following script to create a Manual service. You need to change the values in the variables, and you might need to change other values too (e.g.  --Startup if you want this service to be automatic):

@echo off
set DAEMON_EXEC="C:\commons-daemon-1.0.15-bin-windows\amd64\prunsrv.exe"
set SERVER_START_COMMAND="C:\CLM\6.0.1\server\server.startup.bat"
set SERVER_START_COMMAND_PATH="C:\CLM\6.0.1\server"
set SERVER_STOP_COMMAND="C:\CLM\6.0.1\server\server.shutdown.bat"
set SERVER_STOP_COMMAND_PATH="C:\CLM\6.0.1\server"
set LOG_PATH="C:\CLM\6.0.1\server\logs\daemon"
set SERVICE_NAME=CLM601_LIBERTY
set SERVICE_DISPLAY_NAME="CLM 6.0.1 running in Liberty Profile"
set SERVICE_DESCRIPTION="CLM 6.0.1 running in Liberty Profile"
set INSTALL_SERVICE_COMMAND=%DAEMON_EXEC% //IS//%SERVICE_NAME%  --Startup=manual --DisplayName=%SERVICE_DISPLAY_NAME% --Description=%SERVICE_DESCRIPTION% ++DependsOn=Tcpip --LogPath=%LOG_PATH% --StdOutput=auto --StdError=auto --StartMode=exe --StartPath=%SERVER_START_COMMAND_PATH% --StartImage=%SERVER_START_COMMAND% --StopMode=exe --StopPath=%SERVER_STOP_COMMAND_PATH% --StopImage=%SERVER_STOP_COMMAND%

%INSTALL_SERVICE_COMMAND%

Ralph Schoon selected this answer as the correct answer

9 votes

Comments

WOW!! This was the perfect answer. I had the CLM WAS Liberty process running as a service in short order. This was easier than setting up Apache/Tomcat!

Roberto, thanks so much for posting such a complete and succinct solution. You rock!

1 vote

 Agreed, this is a perfect answer.  It took me literally 10 minutes to configure Liberty to run as a Windows service.


5 other answers

Permanent link
Hi Jeffery

I found this forum link and there is a user who has confirmed that it works.

2 votes

Comments
Hi Shubjit

I've tried the Apache Daemon and yes functionally it successfully creates a Windows service which can be started/stopped. It seems particularly nice because it uses the server.startup.bat it's easy to change the JVM parameters.

The catch I've found is that Windows (at least 2012 R2 and 2016 server editions) is so keen/desperate to stop services quickly during shutdown that it ignores the fact that Liberty hasn't actually stopped and just shuts down regardless, stopping Liberty dead of course. At the next startup the rm log often shows that RM wasn't shut down properly - this is risking RM index corruption which may require a full reindex. I've done some searching and while there should be a registry variable WaitToKillServiceTimeout which should be able to extend how long Windows waits, it doesn't seem to have any effect.

It seems that using Apache Daemon is in the "sort of works but can cause lurking problems" category - it definitely seems dangerous when running DOORS Next Generation. And of course it's formally not supported.

You might want to try this solution and see if it successfully "blocks" Windows from shutting down until Liberty is fully shutdown.


Hi Robert - yes @kenny smith contributed the same answer, and Kenny's method like the Apache Daemon method works perfectly well to start/stop Liberty manually but I couldn't get it to work any better during Windows shutdown - so Liberty (and presumably DB2 which I have on this same test env) is still being stopped dead.


Permanent link

Can't seem to comment on this topic so asking a question in the answer box.  The Apache document says the following:

Both Win32 and UNIX like platforms are supported. For Win32 platforms use procrun. For UNIX like platforms use jsvc.

Has anyone used this on a 64x windows system

0 votes

Comments

 Hi Thomas


Yes we tested this on Windows 64 bit and it worked. We have included this in our deployment Wiki.

Thank you Shubjit,

I followed the wiki and everything worked fine except for the daemon logs.  The "C:\IBM\JazzTeamServer\server\logs" folder does not exist until WLP has been started once so the first messages are missed.


Permanent link
As I said above, I have tried Apache Daemon with multiple versions 6.0.5 - 6.0.6.1 and while it works in terms of creating a Windows service that can be started and stopped, my experience was that there is definitely a problem cleanly stopping liberty and the apps running in it during Windows shutdown.

What seems to happen is that Windows is so keen to shutdown quickly that it waits a nominal 12 seconds then carries on shutting down. On my VM, manually stopping the service takes about 25s for Liberty to exit and release RAM, watching Task Manager. From the same starting point with the service running I can restart Windows in 15s - this has to be stopping Liberty and DB2 dead, in the middle of whatever it was doing.

This is a hazard for at least DOORS Next Generation, which on subsequent startup often complains that the app wasn't cleanly shutdown - and if it wasn't cleanly shutdown this is risking index corruption which might require a full reindex. And of course running Liberty as a service is formally not supported.

As a result I'd avoid Apache Daemon on any production/staging environment which might have non-admin-initiated server shutdown/restarts.

Be great if anyone can tell me how to configure Windows to be more patient?

0 votes


Permanent link

 A MUCH easier way is to use the WIndows task panels. This requires no external tool, libraries, or shell scripts. 

0 votes

Comments
Hi Kenny

I really wanted your solution to work, but I couldn't get it to. In fact restart was even faster using your method of shutdown - I got as low as 6s.

I'm using Windows 2012R2 Server. What version of Windows are you using? How did you confirm that shutdown completes cleanly? If the shutdown happens significantly quicker than the time Liberty normally takes to free all the memory it is allocated in response to a manual shutdown then it was too quick. The only way I know to confirm that shutdown wasn't clean is that during subsequent Liberty startup in rm.log DOORS Next Generation displays "CRJZS6073W The server did not shut down properly, which might have corrupted the RDF indexes located at C:\IBM\JazzTeamServer\server\conf\rm\indices\...."

 I've used this on Windows 2012 server (not sure the revision of it), as well as Windows 10 (my local laptop). I've not noticed this issue when I've done this. I'll go back and check my instructions just to make sure I've got every step listed. 


Permanent link

I need help windows service for CLM 6.0.1is not working properly.

https://validedge.com/err-connection-timed-out/

0 votes

Comments

Here some suggestions:

  1. Do not answer on an old accepted question with a new question 
  2. Create your own question
  3. The question above does not contain any information that could reasonably be used - contact support or provide information e.f. see How should I ask a question in the Forum if I want to receive useful answers?
  4. I would have converted this into a question, but there is nothing in there that would be actionable

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 2,357

Question asked: Jan 08 '16, 5:07 p.m.

Question was seen: 10,380 times

Last updated: Jun 18 '19, 1:25 p.m.

Confirmation Cancel Confirm