O serviço jboss não está sendo inicializado no CentOS7

0

Não é possível preparar scripts initd no Centos 7. Eu instalei o JBOSS EAP7 que vem com scripts initd embutidos para iniciar o serviço. Eu começo / paro / reinicio os serviços como o seguinte, que funciona bem. No entanto, quando eu garfo os mesmos scripts initd via systemd não funciona. Qualquer ajuda seria apreciada.

# /opt/jboss/bin/init.d/jboss-eap-rhel.sh start
Starting jboss-eap: /root
                                                           [  OK  ]
# /opt/jboss/bin/init.d/jboss-eap-rhel.sh status
jboss-eap is running (pid 3024)

# /opt/jboss/bin/init.d/jboss-eap-rhel.sh stop
Stopping jboss-eap:                                        [  OK  ]

# /opt/jboss/bin/init.d/jboss-eap-rhel.sh status
jboss-eap is not running

# /opt/jboss/bin/init.d/jboss-eap-rhel.sh start
Starting jboss-eap: /root
                                                           [  OK  ]
# /opt/jboss/bin/init.d/jboss-eap-rhel.sh status
jboss-eap is running (pid 3314)

Bifurcando os mesmos scripts initd via systemd, dá um erro.

# cat /etc/systemd/system/jbosseap7.service
[Unit]
Description=JBoss EAP7
After=syslog.target
After=network.target

[Service]
Type=forking
ExecStart=/opt/jboss/bin/init.d/jboss-eap-rhel.sh start
ExecStop=/opt/jboss/bin/init.d/jboss-eap-rhel.sh stop
ExecReload=/opt/jboss/bin/init.d/jboss-eap-rhel.sh restart
PIDFile=/var/run/jboss-eap/jboss-eap-standalone.pid

[Install]
WantedBy=multi-user.target


# time systemctl start jbosseap7
Job for jbosseap7.service failed because a timeout was exceeded. See "systemctl status jbosseap7.service" and "journalctl -xe" for details.

real    **1m27.330s**
user    0m0.008s
sys     0m0.003s

# time systemctl status jbosseap7
● jbosseap7.service - JBoss EAP7
   Loaded: loaded (/etc/systemd/system/jbosseap7.service; enabled; vendor preset: disabled)
   Active: failed (Result: timeout) since Mon 2018-06-11 07:04:29 EDT; 15s ago

Jun 11 06:58:22 node01.local.com systemd[1]: Starting JBoss EAP7...
Jun 11 06:58:22 node01.local.com runuser[4071]: pam_unix(runuser:session): session opened for user jboss by (uid=0)
Jun 11 06:58:22 node01.local.com jboss-eap-rhel.sh[4060]: Starting jboss-eap: /
Jun 11 06:58:39 node01.local.com jboss-eap-rhel.sh[4060]: [  OK  ]
Jun 11 06:58:39 node01.local.com systemd[1]: PID file /var/run/jboss-eap/jboss-eap-standalone.pid not readable (yet?) after start.
Jun 11 07:04:28 node01.local.com systemd[1]: jbosseap7.service start operation timed out. Terminating.
Jun 11 07:04:29 node01.local.com systemd[1]: Failed to start JBoss EAP7.
Jun 11 07:04:29 node01.local.com systemd[1]: Unit jbosseap7.service entered failed state.
Jun 11 07:04:29 node01.local.com systemd[1]: jbosseap7.service failed.

real    0m0.045s
user    0m0.004s
sys     0m0.000s

Observação: até tentei especificar o limite de tempo limite na unidade [SERVICE], mas isso ainda não funciona. Sem especificar o limite de tempo, ainda demora muito tempo (1 minuto e 27 segundos). O que poderia estar errado aqui?

Comentários adicionais:

Às vezes começa e às vezes não começa. Como podemos pegar o que falhou?

# systemctl start jbosseap7
# systemctl status jbosseap7
● jbosseap7.service - JBoss EAP7
   Loaded: loaded (/etc/systemd/system/jbosseap7.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Mon 2018-06-11 07:32:47 EDT; 7s ago
  Process: 2913 ExecStop=/etc/init.d/jboss-eap-rhel.sh stop (code=exited, status=0/SUCCESS)
  Process: 2771 ExecStart=/etc/init.d/jboss-eap-rhel.sh start (code=exited, status=0/SUCCESS)
 Main PID: 2537 (code=exited, status=0/SUCCESS)

Jun 11 07:32:15 node01.local.com systemd[1]: Starting JBoss EAP7...
Jun 11 07:32:15 node01.local.com runuser[2782]: pam_unix(runuser:session): session opened for user jboss by (uid=0)
Jun 11 07:32:15 node01.local.com jboss-eap-rhel.sh[2771]: Starting jboss-eap: /
Jun 11 07:32:46 node01.local.com jboss-eap-rhel.sh[2771]: jboss-eap started with errors, please see server log for details
Jun 11 07:32:46 node01.local.com jboss-eap-rhel.sh[2771]: [  OK  ]
Jun 11 07:32:47 node01.local.com jboss-eap-rhel.sh[2913]: Stopping jboss-eap: [  OK  ]
Jun 11 07:32:47 node01.local.com systemd[1]: Started JBoss EAP7.

# ps -ef | grep jboss
root      2924  2222  0 07:33 pts/0    00:00:00 grep --color=auto jboss

# systemctl start jbosseap7

# systemctl status jbosseap7
● jbosseap7.service - JBoss EAP7
   Loaded: loaded (/etc/systemd/system/jbosseap7.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-06-11 07:33:35 EDT; 3s ago
  Process: 2913 ExecStop=/etc/init.d/jboss-eap-rhel.sh stop (code=exited, status=0/SUCCESS)
  Process: 2930 ExecStart=/etc/init.d/jboss-eap-rhel.sh start (code=exited, status=0/SUCCESS)
 Main PID: 2943 (standalone.sh)
   CGroup: /system.slice/jbosseap7.service
           ├─2943 /bin/sh /opt/jboss/bin/standalone.sh -c standalone.xml
           └─3012 java -D[Standalone] -server -verbose:gc -Xloggc:/opt/jboss/standalone/log/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:Nu...

Jun 11 07:33:19 node01.local.com systemd[1]: Starting JBoss EAP7...
Jun 11 07:33:19 node01.local.com runuser[2941]: pam_unix(runuser:session): session opened for user jboss by (uid=0)
Jun 11 07:33:19 node01.local.com jboss-eap-rhel.sh[2930]: Starting jboss-eap: /
Jun 11 07:33:35 node01.local.com jboss-eap-rhel.sh[2930]: [  OK  ]
Jun 11 07:33:35 node01.local.com systemd[1]: Started JBoss EAP7.

Resultados PS:

# ps -aux|grep jboss
jboss     4559  0.0  0.0 113120  1540 ?        S    07:58   0:00 /bin/sh /opt/jboss/bin/standalone.sh -c standalone.xml
jboss     4628 49.4 33.9 3077608 640432 ?      Sl   07:58   0:15 java -D[Standalone] -server -verbose:gc -Xloggc:/opt/jboss/standalone/log/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/jboss/standalone/log/server.log -Dlogging.configuration=file:/opt/jboss/standalone/configuration/logging.properties -jar /opt/jboss/jboss-modules.jar -mp /opt/jboss/modules org.jboss.as.standalone -Djboss.home.dir=/opt/jboss -Djboss.server.base.dir=/opt/jboss/standalone -c standalone.xml
root      4754  0.0  0.0 112644   952 pts/0    R+   07:58   0:00 grep --color=auto jboss
    
por Gokulnath Kumar 11.06.2018 / 13:08

1 resposta

0

Nos logs do daemon systemctl, é óbvio que ele está tentando ler o arquivo pid do jboss.

Portanto, primeiro remova seu arquivo pid:

rm /var/run/jboss-eap/jboss-eap-standalone.pid

Agora, comente a linha abaixo e recarregue o daemon:

#PIDFile=/var/run/jboss-eap/jboss-eap-standalone.pid
systemctl daemon-reload

Em seguida, inicie o serviço jboss.

systemctl start jbosseap7
    
por 11.06.2018 / 13:19

Tags