jboss_eap icon indicating copy to clipboard operation
jboss_eap copied to clipboard

Problem by configure JBoss EAP 6.x as Service on RHEL 7

Open thomas2004ch opened this issue 5 years ago • 19 comments

I recently upgrade the RHEL6 to RHEL7. But I still have to use the Jboss EAP6 for a while. After upgrate to RHEL7 I have problem by starting the jboss since by RHEL7 it works quite different than by RHEL6. One has to use the 'systemctl'. I've googled but couldn't find any helpful information.

After installed the Jboss EAP6 there is a file /etc/init.d/jbossas. I enable this as service with chkconfig jbossas on

Then I create a file '/usr/lib/systemd/system/eap6-jbossas-standalone.service' and it looks as below: `[Unit] Description=JBoss EAP Systemctl script After=NetworkManager.service

[Service] Type=forking ExecStart=/etc/init.d/jbossas start ExecStop=/etc/init.d/jbossas stop PIDFile=/var/run/jbossas/jbossas-standalone.pid`

Then I start the jboss with systemctl start eap6-jbossas-standalone

The jboss can be started but the cursor doesn't return. I have to use the ctrl+c to get the cursor.

I try to stop the jboss with systemctl stop eap6-jbossas-standalone

but the jboss can not be stopped. As I check its status with systemctl status eap6-jbossas-standalone -l

I got following messages: `# systemctl status eap6-jbossas-standalone -l ● eap6-jbossas-standalone.service - JBoss EAP Systemctl script Loaded: loaded (/usr/lib/systemd/system/eap6-jbossas-standalone.service; static; vendor preset: disabled) Active: inactive (dead)

Aug 28 10:04:59 s001ap21-test-n.ad001.proactiv.grp systemd[1]: Failed to start JBoss EAP Systemctl script. Aug 28 10:04:59 s001ap21-test-n.ad001.proactiv.grp systemd[1]: Unit eap6-jbossas-standalone.service entered failed state. Aug 28 10:04:59 s001ap21-test-n.ad001.proactiv.grp systemd[1]: eap6-jbossas-standalone.service failed. Aug 28 10:15:24 s001ap21-test-n.ad001.proactiv.grp systemd[1]: Starting JBoss EAP Systemctl script... Aug 28 10:15:24 s001ap21-test-n.ad001.proactiv.grp runuser[15400]: pam_unix(runuser:session): session opened for user jboss by (uid=0) Aug 28 10:15:24 s001ap21-test-n.ad001.proactiv.grp runuser[15400]: pam_unix(runuser:session): session closed for user jboss Aug 28 10:15:24 s001ap21-test-n.ad001.proactiv.grp runuser[15403]: pam_unix(runuser:session): session opened for user jboss by (uid=0) Aug 28 10:15:24 s001ap21-test-n.ad001.proactiv.grp runuser[15403]: pam_unix(runuser:session): session closed for user jboss Aug 28 10:15:24 s001ap21-test-n.ad001.proactiv.grp jbossas[15384]: Starting jbossas: runuser: warning: cannot change directory to /opt/rh/eap7/root/usr/share/wildfly: No such file or directory Aug 28 10:15:52 s001ap21-test-n.ad001.proactiv.grp systemd[1]: Stopped JBoss EAP Systemctl script. jboss6.x rhel7`

P.S.: I installed the Jboss EAP 6.4.22 byusing the text rpm: yum groupinstall "jboss eap 6"

thomas2004ch avatar Aug 30 '19 06:08 thomas2004ch

@thomas2004ch First of all, are you running SELinux? If so, just disable and try again. Also, I think you may have install EAP7 along with it, because this folder comes with EAP7: /opt/rh/eap7/root/usr/share/wildfly.

Can you run a $ rpminfo -q eap7-standalone to check if EAP7 is indeed installed. (btw, unless there is a requirement to use EAP 6.4, I would recommend using EAP7).

rpelisse avatar Aug 30 '19 07:08 rpelisse

@rpelisse 1. My OS is RHEL7.7. 2. I've installed the Jboss EAP7 before. But I've deleted it before I installed the Jboss EAP6. I see the '/opt/rh/eap7/root/usr/share/wildfly' fomr the error messages.

I ran the command you mentioned and got followings:

# rpminfo -q eap7-standalone 'eap7-standalone' is not installed and is no rpm package.. skipping! It seems the delete of Jboss EAP7 is not clean?

thomas2004ch avatar Aug 30 '19 07:08 thomas2004ch

@rpelisse 1. My OS is RHEL7.7.

I'm not sure why you are reply that, that's not really what I've asked for :) !

Can you check if you are running SELinux running this command:

$ getenforce

I've installed the Jboss EAP7 before. But I've deleted it before I installed the Jboss EAP6. I see the '/opt/rh/eap7/root/usr/share/wildfly' fomr the error messages.

I ran the command you mentioned and got followings:

# rpminfo -q eap7-standalone 'eap7-standalone' is not installed and is no rpm package.. skipping! It seems the delete of Jboss EAP7 is not clean?

It seems so. But let leave that for now and try to understand what is happening here. Can you copy and paste the content of /etc/init.d/jbossas? (or at rather the first 30 lines)

rpelisse avatar Aug 30 '19 07:08 rpelisse

Opps, sorry for the misunderstanding.

The SElinux is disable.

Here is the jbossas.log. Please change it to jbossas. jbossas.log

thomas2004ch avatar Aug 30 '19 08:08 thomas2004ch

Ok, nothing wrong here. We need now to look at those two configuration file:

  • /etc/jbossas/jbossas.conf
  • /etc/sysconfig/jbossas

rpelisse avatar Aug 30 '19 08:08 rpelisse

Here are the files you need. The jboss.conf.log is the /etc/jbossas/jbossas.conf The jbossas.sys.log is the /etc/sysconfig/jbossas.

jbossas.conf.log jbossas.sys.log

thomas2004ch avatar Aug 30 '19 08:08 thomas2004ch

Ok, both have the same content and both are entirely commented out. Just as a test and a potential workaround can uncomment the following line in both file:

# Define where jboss is - this is the directory containing directories appclient, bin, bundles, docs, domain etc JBOSS_HOME="/usr/share/jbossas"

Then, run

# systemctl start eap6-jbossas-standalone

Also can you check if the file /usr/lib/systemd/system/eap7-standalone.service is still around? If so remove it. Is there one like that for eap6?

rpelisse avatar Aug 30 '19 08:08 rpelisse

I did what you said above. But as I start the jboss with systemctl start eap6-jbossas-standalon I got error as follow: Failed to start eap6-jbossas-standalone.service: Unit not found.

Also can you check if the file /usr/lib/systemd/system/eap7-standalone.service is still around? If so remove it.

This file doesn't exsist. There is the file '/usr/lib/systemd/system/eap6-jbossas-standalone.service'.

thomas2004ch avatar Aug 30 '19 10:08 thomas2004ch

Getting this error while having the file /usr/lib/systemd/system/eap6-jbossas-standalone.service is weird. Did you reload systemd-daemon? If not, please do so and try again to start the service:

# systemctl daemon-reload
# systemctl start eap6-jbossas-standalone

Also, can you attach this file /usr/lib/systemd/system/eap6-jbossas-standalone.service?

rpelisse avatar Aug 30 '19 10:08 rpelisse

You are right.

Now there is no error as I start the jboss. But the cursor doesn't return. I open another putty console and check the prozess with ps -ef | grep java and get following: root 28072 28051 0 12:32 pts/1 00:00:00 grep --color=auto java It seems the jboss is not started.

After about 1min I got following messages from the 1.st putty console: Job for eap6-jbossas-standalone.service failed because the control process exited with error code. See "systemctl status eap6-jbossas-standalone.service" and "journalctl -xe" for details.

thomas2004ch avatar Aug 30 '19 10:08 thomas2004ch

I run the systemctl status eap6-jbossas-standalone.service -l and get: `● eap6-jbossas-standalone.service - JBoss EAP Systemctl script Loaded: loaded (/usr/lib/systemd/system/eap6-jbossas-standalone.service; static; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2019-08-30 12:32:15 CEST; 3min 37s ago Process: 27707 ExecStart=/etc/init.d/jbossas start (code=exited, status=3)

Aug 30 12:31:05 s001ap21-test-n.ad001.proactiv.grp runuser[27723]: pam_unix(runuser:session): session closed for user jboss Aug 30 12:31:05 s001ap21-test-n.ad001.proactiv.grp runuser[27726]: pam_unix(runuser:session): session opened for user jboss by (uid=0) Aug 30 12:31:05 s001ap21-test-n.ad001.proactiv.grp runuser[27726]: pam_unix(runuser:session): session closed for user jboss Aug 30 12:31:05 s001ap21-test-n.ad001.proactiv.grp jbossas[27707]: Starting jbossas: runuser: warning: cannot change directory to /opt/rh/eap7/root/usr/share/wildfly: No such file or directory Aug 30 12:32:15 s001ap21-test-n.ad001.proactiv.grp jbossas[27707]: [FAILED] Aug 30 12:32:15 s001ap21-test-n.ad001.proactiv.grp jbossas[27707]: Process crashed on startup Aug 30 12:32:15 s001ap21-test-n.ad001.proactiv.grp systemd[1]: eap6-jbossas-standalone.service: control process exited, code=exited status=3 Aug 30 12:32:15 s001ap21-test-n.ad001.proactiv.grp systemd[1]: Failed to start JBoss EAP Systemctl script. Aug 30 12:32:15 s001ap21-test-n.ad001.proactiv.grp systemd[1]: Unit eap6-jbossas-standalone.service entered failed state. Aug 30 12:32:15 s001ap21-test-n.ad001.proactiv.grp systemd[1]: eap6-jbossas-standalone.service failed. `

thomas2004ch avatar Aug 30 '19 10:08 thomas2004ch

And I find there is a directory /opt/rh/eap6/root/usr/share/

I am not sure if this comes from the eap6?

thomas2004ch avatar Aug 30 '19 10:08 thomas2004ch

Aug 30 12:31:05 s001ap21-test-n.ad001.proactiv.grp jbossas[27707]: Starting jbossas: runuser: warning: cannot change directory to /opt/rh/eap7/root/usr/share/wildfly: No such file or directory

Why are we still getting this?

Let's move away of systemd for awhile and try to see if jboss works on its own first:

$ cd /usr/share/jbossas/
$ ./bin/standalone.sh

This should start the server and log directly in your screen. If there is a failure, just copy and paste the result here.

Also, systemd has logfile where it puts the output of jboss

# JBOSS_CONSOLE_LOG=/var/log/jbossas/$JBOSSCONF/console.log

This will give us more input on what is wrong.

rpelisse avatar Aug 30 '19 10:08 rpelisse

Still getting the '/opt/rh/eap7/root/usr/share/wildfly' maybe the deletion of eap7 not 100% clean, I guess.

use /usr/share/jbossas//bin/standalone.sh -b ip the Jboss can be started without any error. 13:20:20,150 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.4.22.GA (AS 7.5.22.Final-redhat-1) started in 2398ms - Started 153 of 191 services (57 services are lazy, passive or on-demand)

The size of '/var/log/jbossas/standalone/console.log' is 0, since there is no any error by startting jboss?

In the '/var/log/jbossas/standalone/server.log' there is no any ERROR.

thomas2004ch avatar Aug 30 '19 11:08 thomas2004ch

OK, so EAP7 itself works, but the integration of it, as a systemd service, is broken. Can you attach the /usr/lib/systemd/system/eap6-jbossas-standalone.service file?

rpelisse avatar Aug 30 '19 13:08 rpelisse

Sorry for the late reply bcz. of weekend. Here is the file. You should remove the .log. eap6-jbossas-standalone.service.log

thomas2004ch avatar Sep 02 '19 04:09 thomas2004ch

Besides, where do you know the EAP7 itself works? But in fact, at the beginning I installed the EAP7 and it works indeed.

thomas2004ch avatar Sep 02 '19 05:09 thomas2004ch

I think my problem is solved. I restore the server completely and now it works. It seems it is because the not cleaning delete of the jboss eap 7.

Many thanks!

thomas2004ch avatar Sep 04 '19 13:09 thomas2004ch

@thomas2004ch Could you provide a setup including the customizations that are necessary to make this role work for EAP 6.4? We have to integrate a product and our software vendor is not yet on EAP 7.

lostiniceland avatar Apr 12 '20 07:04 lostiniceland