Bug 850777 - EWS2DOC: 4.5. Running Enterprise Web Server - wrong paths and text
EWS2DOC: 4.5. Running Enterprise Web Server - wrong paths and text
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Web Server 2
Classification: JBoss
Component: doc-Installation-Guide (Show other bugs)
2.0.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Misha H. Ali
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-22 08:11 EDT by Jan Stefl
Modified: 2012-11-08 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-08 17:11:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Stefl 2012-08-22 08:11:35 EDT
Description of problem:
Link:
http://documentation-stage-02.lab.eng.bne.redhat.com/docs/en-US/JBoss_Enterprise_Web_Server/2/html/Installation_Guide/sec-Running_EWS.html

Chapter 4.5.1.1. Running Tomcat as a Program
-------------------------------------------------------------------
wrong path:
/opt/redhat/ews/sbin/tomcat<VERSION> start -> /opt/jboss-ews-2.0/sbin/tomcat<VERSION> start

/opt/redhat/ews/share/tomcat<VERSION>/bin/catalina.sh -> /opt/jboss-ews-2.0/share/tomcat<VERSION>/bin/catalina.sh

btw. installation root is for all platforms $EWS_HOME/jboss-ews-2.0

--------------------------------------------------------------------
{quote}
To run Tomcat as a service you can use either the Tomcat script located in the init.d or you can create and use your own system daemon script with jsvc or tanukiwrapper.
{quote}

We rid of tunakiwrapper in a EAP, and I have not seen any binaries of it in EWS2
I really belive we can remove mention about it.
---------------------------------------------------------------------
Comment 1 Misha H. Ali 2012-08-23 22:12:19 EDT
Thanks for reporting this Jan. FYI, the new stage is at the following link (useful to QE the desired changes later):

http://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Enterprise_Web_Server/2/html/Installation_Guide/sec-Running_EWS.html
Comment 2 gsheldon 2012-09-18 22:14:13 EDT
Updated both paths:

Chapter 4.5.1.1. Running Tomcat as a Program

" To start Tomcat with the tomcat script, run the following command as the root user with the respective Tomcat version (6 or 7): 

/opt/jboss-ews-2.0/sbin/tomcat<VERSION> start"

And:

"To start Tomcat with the catalina.sh script, run the following command with the respective Tomcat version (6 or 7):

opt/jboss-ews-2.0/share/tomcat<VERSION>/bin/catalina.sh"

tunakiwrapper is no longer referred to in the sentence mentioned above. Now appears as:

'To run Tomcat as a service you can use either the Tomcat script located in the init.d or you can create and use your own system daemon script with jsvc."
Comment 3 Jan Stefl 2012-09-19 03:36:15 EDT
About the last sentence:
{quote}
'To run Tomcat as a service you can use either the Tomcat script located in the init.d or you can create and use your own system daemon script with jsvc."
{quote}

This is absolutely valid for tomcat 6, but for tomcat 7 there is prepared script  in /opt/jboss-ews-2.0/share/apache-tomcat-7.x/bin/daemon.sh and user don't have to create own.
Comment 4 Misha H. Ali 2012-09-20 03:38:48 EDT
Now available to QE on the stage at the following link:

http://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Enterprise_Web_Server/2/html/Installation_Guide/sec-Running_EWS.html

Please refer to the header "4.5.1.2. Running Tomcat as a Service"
Comment 5 Jan Stefl 2012-10-09 07:33:42 EDT
Hi,

thank you for the updates, It looks better now. 
Just two things:

http://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Enterprise_Web_Server/2/html/Installation_Guide/sec-Running_EWS.html

1 ----------------------------------------------------------------
4.5.1.1. Running Tomcat as a Program
/opt/redhat/ews/lib/ path (/opt/redhat/ews/lib64) 
-> 
/opt/jboss-ews-2.0/lib/ path (/opt/jboss-ews-2.0/lib64)
----------------------------------------------------------------

2 ----------------------------------------------------------------
4.5.1.2. Running Tomcat as a Service
{original}
To run Tomcat as a service:
In Tomcat 6, use the script located in the init.d file or ...
{original}

{should-be}
To run Tomcat as a service with jsvc:
In Tomcat 6, use the script located in the init.d file or ...
{should-be}

It would be great if there were a sample of jsvc command for tomcat6
smth. like.
I suggest consult it with developers, for instance Mladen Turk (mturk)
{code}
/opt/jboss-ews-2.0/sbin/jsvc 
-cp /opt/jboss-ews-2.0/share/tomcat6/bin/bootstrap.jar  
-outfile /opt/jboss-ews-2.0/share/tomcat6/logs/catalina.out 
-errfile /opt/jboss-ews-2.0/share/tomcat6/logs/catalina.err 
-pidfile /opt/jboss-ews-2.0/share/tomcat6/tomcat6.pid   
-user tomcat  
-Dcatalina.home=/opt/jboss-ews-2.0/share/tomcat6 
-Djava.io.tmpdir=/opt/jboss-ews-2.0/share/tomcat6/temp 
-jvm server org.apache.catalina.startup.Bootstrap
{code}

{original}
To run Tomcat as a service, create symbolic links to the provided Tomcat scripts using the following command:
ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION> /etc/rc3.d/S70tomcat<VERSION>
ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION> /etc/rcS.d/K20tomcat<VERSION>
{original}

{should-be}
To run Tomcat as a service, create symbolic links to the provided Tomcat scripts using the following command:
ln -s /opt/jboss-ews-2.0/etc/rc.d/init.d/tomcat<VERSION> /etc/rc3.d/S70tomcat<VERSION>
ln -s /opt/jboss-ews-2.0/etc/rc.d/init.d/tomcat<VERSION> /etc/rcS.d/K20tomcat<VERSION>
{should-be}
----------------------------------------------------------------
Comment 6 Jan Stefl 2012-10-09 08:14:35 EDT
!Important 

About services (not jsvc) - we could remove following text

{remove}
To run Tomcat as a service, create symbolic links to the provided Tomcat scripts using the following command:

ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION> /etc/rc3.d/S70tomcat<VERSION>
ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION> /etc/rcS.d/K20tomcat<VERSION>

Define the init level numbers (for information on how define init level numbers consult your Solaris documentation). The preferred method of service management is through the Solaris Service Management Facility. In order to read more about this facility, consult the smf(5) manual.
{remove}

Because this will not be supported anymore (JBPAPP-9733).
Comment 7 Misha H. Ali 2012-10-09 20:40:04 EDT
(In reply to comment #5)
> Hi,
> 
> thank you for the updates, It looks better now. 
> Just two things:
> 
> http://documentation-devel.engineering.redhat.com/docs/en-US/
> JBoss_Enterprise_Web_Server/2/html/Installation_Guide/sec-Running_EWS.html
> 
> 1 ----------------------------------------------------------------
> 4.5.1.1. Running Tomcat as a Program
> /opt/redhat/ews/lib/ path (/opt/redhat/ews/lib64) 
> -> 
> /opt/jboss-ews-2.0/lib/ path (/opt/jboss-ews-2.0/lib64)
> ----------------------------------------------------------------
> 

Apologies, that one got away. Did a document-wide search and replace for the path "/opt/redhat/ews" and replaced with "/opt/jboss-ews-2.0", which should get rid of all these path problems.

> 2 ----------------------------------------------------------------
> 4.5.1.2. Running Tomcat as a Service
> {original}
> To run Tomcat as a service:
> In Tomcat 6, use the script located in the init.d file or ...
> {original}
> 
> {should-be}
> To run Tomcat as a service with jsvc:
> In Tomcat 6, use the script located in the init.d file or ...
> {should-be}
> 

Done.

> It would be great if there were a sample of jsvc command for tomcat6
> smth. like.
> I suggest consult it with developers, for instance Mladen Turk (mturk)
> {code}
> /opt/jboss-ews-2.0/sbin/jsvc 
> -cp /opt/jboss-ews-2.0/share/tomcat6/bin/bootstrap.jar  
> -outfile /opt/jboss-ews-2.0/share/tomcat6/logs/catalina.out 
> -errfile /opt/jboss-ews-2.0/share/tomcat6/logs/catalina.err 
> -pidfile /opt/jboss-ews-2.0/share/tomcat6/tomcat6.pid   
> -user tomcat  
> -Dcatalina.home=/opt/jboss-ews-2.0/share/tomcat6 
> -Djava.io.tmpdir=/opt/jboss-ews-2.0/share/tomcat6/temp 
> -jvm server org.apache.catalina.startup.Bootstrap
> {code}
> 

Added as an RFE for EWS.Next (https://bugzilla.redhat.com/show_bug.cgi?id=864715)

> {original}
> To run Tomcat as a service, create symbolic links to the provided Tomcat
> scripts using the following command:
> ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION>
> /etc/rc3.d/S70tomcat<VERSION>
> ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION>
> /etc/rcS.d/K20tomcat<VERSION>
> {original}
> 
> {should-be}
> To run Tomcat as a service, create symbolic links to the provided Tomcat
> scripts using the following command:
> ln -s /opt/jboss-ews-2.0/etc/rc.d/init.d/tomcat<VERSION>
> /etc/rc3.d/S70tomcat<VERSION>
> ln -s /opt/jboss-ews-2.0/etc/rc.d/init.d/tomcat<VERSION>
> /etc/rcS.d/K20tomcat<VERSION>
> {should-be}
> ----------------------------------------------------------------

Done.
Comment 9 Jan Stefl 2012-10-10 06:46:04 EDT
Thank you for the changes. Last thing remains:

the part
{original}
To run Tomcat as a service, create symbolic links to the provided Tomcat scripts using the following command:
ln -s /opt/jboss-ews-2.0/etc/rc.d/init.d/tomcat<VERSION> /etc/rc3.d/S70tomcat<VERSION>
ln -s /opt/jboss-ews-2.0/etc/rc.d/init.d/tomcat<VERSION> /etc/rcS.d/K20tomcat<VERSION>
Define the init level numbers (for information on how define init level numbers consult your Solaris documentation). The preferred method of service management is through the Solaris Service Management Facility. In order to read more about this facility, consult the smf(5) manual.
{original}

Should be changed, because in new EWS path /opt/jboss-ews-2.0/etc/rc.d/init.d/tomcat<VERSION> will be removed (it was for Solaris9).
Remains question could we do smtk like or anything similar:

{suggest}
ln -s /opt/jboss-ews-2.0/sbin/tomcat<VERSION> /etc/rc3.d/S70tomcat<VERSION>
ln -s /opt/jboss-ews-2.0/sbin/tomcat<VERSION> /etc/rcS.d/K20tomcat<VERSION>
{suggest}

Please consult with developer. I belive Mladen Turk (mturk) will know.
Comment 10 Misha H. Ali 2012-10-11 00:33:22 EDT
Adding NEEDINFO for Mladen. Mladen, can you comment on c#9?
Comment 11 Mladen Turk 2012-10-11 00:47:16 EDT
Do not use "ln -s ..." for /opt/jboss-ews-2.0/sbin/tomcat<VERSION> !!!

The proper Solaris setup for service/daemons is by using scm admin facility.
What I would do is point the user to the documentation about that.
It's not a trivial thing and requires an .xml file which user must create.

Eg, it should look something like this:
<?xml version='1.0'?>
 <!DOCTYPE service_bundle SYSTEM
 '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<!--  Service manifest for Apache Tomcat
 -->
<service_bundle type='manifest' name='tomcat6:tomcat6'>
 <service
  name='network/tomcat6'
  type='service'
  version='1'>
 <create_default_instance enabled='false' />
  <single_instance />
  <dependency name='fs'
   grouping='require_all'
   restart_on='none'
   type='service'>
  <service_fmri value='svc:/system/filesystem/local' />
   </dependency>
  <dependency name='net'
   grouping='require_all'
   restart_on='none'
   type='service'>
  <service_fmri value='svc:/network/loopback' />
 </dependency>
 <exec_method
  type='method'
  name='start'
  exec='/opt/jboss-ews-2.0/sbin/tomcat start'
  timeout_seconds='-1'>
 </exec_method>
 <exec_method
  type='method'
  name='stop'
  exec='/opt/jboss-ews-2.0/sbin/tomcat stop'
  timeout_seconds='-1'>
 </exec_method>
 <exec_method
  type='method'
  name='restart'
  exec='/opt/jboss-ews-2.0/sbin/tomcat restart'
  timeout_seconds='-1'>
 </exec_method>
 </service>
</service_bundle>

Another approach would be as explained in this link
http://wiki.apache.org/tomcat/TomcatOnSolaris10
(But I'm not pleased with that because it doesn't use specific user)
Comment 12 Misha H. Ali 2012-10-11 01:17:20 EDT
Mladen, can you point me to the correct procedure documented somewhere? I can't spot anything for scm at all in our other documentation. Perhaps a community page we can link to for now?

If you don't know of any such thing, then we will have to go with the second approach for now and change it once we have worked out the details of the first preferred but more complicated approach and tested it.

In the meantime, I am getting rid of of the ln -s options.
Comment 13 Misha H. Ali 2012-10-11 01:22:27 EDT
Or perhaps I can try to outline the procedure and you can correct me where wrong:

1. Create an xml file (something like /var/svc/manifest/application/web/tomcat.xml but probably at a different location and filename)/

2. Add the contents of the file as in comment#11

3. Import/apply the file

# svccfg import /var/svc/manifest/application/web/tomcat.xml in second procedure, but possibly some command with scm instead.

4. Start tomcat, stop tomcat, see tomcat status with scm commands.

Does this seem on the right track, Mladen? Apologies for taking up so much of your time at this late stage.
Comment 14 Mladen Turk 2012-10-11 01:46:53 EDT
(In reply to comment #13)
> 
> Does this seem on the right track, Mladen? Apologies for taking up so much
> of your time at this late stage.

Yes that looks correct and more then enough.
I mean we are writing this for people which should be already familiar with Solaris scm.

You can find more info here
http://en.wikipedia.org/wiki/Service_Management_Facility

http://www.oracle.com/technetwork/server-storage/solaris11/technologies/smf-1690889.html
Comment 15 Misha H. Ali 2012-10-11 03:14:21 EDT
OK, confirmed with the links and docs and cheat sheets and I think I have it sorted. This bug will be set to ON_QA once the new procedure appears on the stage.
Comment 17 Jan Stefl 2012-10-11 05:27:54 EDT
There are at least wrong paths:

{original}
...
exec='/opt/jboss-ews-2.0/sbin/tomcat start'
...
exec='/opt/jboss-ews-2.0/sbin/tomcat stop'
...
exec='/opt/jboss-ews-2.0/sbin/tomcat start'
...
{original}

{should-be}
...
exec='/opt/jboss-ews-2.0/sbin/tomcat6 start'
...
exec='/opt/jboss-ews-2.0/sbin/tomcat6 stop'
...
exec='/opt/jboss-ews-2.0/sbin/tomcat6 start'
...
{should-be}


I tried that description and it doesn't worked.
I followed described steps (as root) and tomcat is not available - there is no relevant process and noting listen on port 8080.
Comment 18 Mladen Turk 2012-10-11 06:07:48 EDT
(In reply to comment #17)
> {should-be}
> ...
> exec='/opt/jboss-ews-2.0/sbin/tomcat6 start'
> ...
> exec='/opt/jboss-ews-2.0/sbin/tomcat6 stop'
> ...
> exec='/opt/jboss-ews-2.0/sbin/tomcat6 start'
> ...
> {should-be}
> 

+1

> 
> I tried that description and it doesn't worked.
> I followed described steps (as root) and tomcat is not available - there is
> no relevant process and noting listen on port 8080.

It works for me

The documentation must say:
sudo /usr/sbin/svcadm enable tomcat6

Note that service name is tomcat6 not tomcat!
Comment 19 Jan Stefl 2012-10-11 07:07:56 EDT
I tried it again, and it works now.

Mischa,
conclusion of comments 17,18 is:

---------------------------------------------
{original}
...
exec='/opt/jboss-ews-2.0/sbin/tomcat start'
...
exec='/opt/jboss-ews-2.0/sbin/tomcat stop'
...
exec='/opt/jboss-ews-2.0/sbin/tomcat start'
...
{original}

{should-be}
...
exec='/opt/jboss-ews-2.0/sbin/tomcat6 start'
...
exec='/opt/jboss-ews-2.0/sbin/tomcat6 stop'
...
exec='/opt/jboss-ews-2.0/sbin/tomcat6 start'
...
{should-be}
---------------------------------------------

{original}
svccfg import /var/svc/manifest/application/web/tomcat.xml
{original}

{should-be}
sudo /usr/sbin/svccfg import /var/svc/manifest/application/web/tomcat.xml
{should-be}

---------------------------------------------

{original}
svcadm enable tomcat
{original}

{should-be}
sudo /usr/sbin/svcadm enable tomcat6
{should-be}
Comment 20 Mladen Turk 2012-10-11 07:10:06 EDT
(In reply to comment #19)
> 
> {original}
> svccfg import /var/svc/manifest/application/web/tomcat.xml
> {original}
> 
> {should-be}
> sudo /usr/sbin/svccfg import /var/svc/manifest/application/web/tomcat.xml
> {should-be}

{should-be}
svccfg import /var/svc/manifest/application/web/tomcat.xml
{should-be}


I just gave sudo as example. If running as root no need for sudo
Comment 21 Jan Stefl 2012-10-11 07:22:23 EDT
Right,

Mischa, could you:
 - add into Procedure 4.10. Use SCM to Run Tomcat as a Service
   "1. At the shell prompt, become the root user."
 - remove sudo from {should-be} at comment 19.
Comment 22 Misha H. Ali 2012-10-12 01:44:34 EDT
Thanks for the clarification, folks. This should be OK now.
Comment 23 Misha H. Ali 2012-11-08 17:11:29 EST
This bug is set to CLOSED CURRENT RELEASE to indicate that this fix is now released and available at access.redhat.com.

Note You need to log in before you can comment on or make changes to this bug.