Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

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

Open
thomas2004ch opened this issue Aug 30, 2019 · 19 comments
Open

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

thomas2004ch opened this issue Aug 30, 2019 · 19 comments

Comments

@thomas2004ch
Copy link

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"

@rpelisse
Copy link
Contributor

@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).

@thomas2004ch
Copy link
Author

@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?

@rpelisse
Copy link
Contributor

@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)

@thomas2004ch
Copy link
Author

Opps, sorry for the misunderstanding.

The SElinux is disable.

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

@rpelisse
Copy link
Contributor

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

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

@thomas2004ch
Copy link
Author

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

@rpelisse
Copy link
Contributor

rpelisse commented Aug 30, 2019

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?

@thomas2004ch
Copy link
Author

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'.

@rpelisse
Copy link
Contributor

rpelisse commented Aug 30, 2019

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?

@thomas2004ch
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

I am not sure if this comes from the eap6?

@rpelisse
Copy link
Contributor

rpelisse commented Aug 30, 2019

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.

@thomas2004ch
Copy link
Author

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.

@rpelisse
Copy link
Contributor

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?

@thomas2004ch
Copy link
Author

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

@thomas2004ch
Copy link
Author

thomas2004ch commented Sep 2, 2019

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

@thomas2004ch
Copy link
Author

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!

@lostiniceland
Copy link

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants