• Home
  • Disclaimer
  • Contact
  • Archives
  • About
  • Subscribe
  • Support
  • Advertise

Kernel Talks

Unix, Linux, & Cloud!

  • How-to guides
    • Howto
    • Disk management
    • Configurations
    • Troubleshooting
  • OS
    • HPUX
    • Linux
  • Miscellaneous
    • Software & Tools
    • Cloud Services
    • System services
    • Virtualization
  • Certification Preparations
    • AWS Certified Solutions Architect – Associate
    • AWS Certified Solutions Architect – Professional
    • AWS Certified SysOps Administrator – Associate
    • AWS Certified Cloud Practitioner
    • Certified Kubernetes Administrator
    • Hashicorp Certified Terraform Associate
    • Oracle Cloud Infrastructure Foundations 2020 – Associate
  • Tips & Tricks
  • Linux commands
You are here: Home / System services

How to configure JBOSS EAP 7 as a service in SUSE Linux

Published: November 8, 2019 | Modified: June 24, 2020



Step by step procedure to configure JBOSS EAP as service in SUSE Linux

JBOSS EAP as service

One of the major requirements for Jboss’s basic installations is to configure Jboss as a service in Linux. It’s pretty easy to configure it in RedHat and related families but when it comes to SUSE it pretty difficult since few functions of RedHat family don’t work in Suse. And with default ZIP installation we do not get the SUSE startup file as well which is readily available for RedHat.

We are considering Jboss EAP 7.2 on Suse 12 for this article.

RedHat has a pretty simple tutorial here which is not going to work on SUSE. So I will walk you through steps to get your Jboss eap working as service in SUSE Linux.


Pre-requisite

  • Make sure you have java installed on the server
  • Make sure JBoss user exists on the server which is defined in jboss-eap.conf file by parameter JBOSS_USER. Default user is jboss-eap
  • For default standalone configurations, INSTALL_PATH/standalone/ should be owned by JBOSS_USER
  • Make changes in init script template to match it with SUSE system as defined in below paragraph

Modification in script

You need to edit default init script INSTALL_PATH/bin/init.d/jboss-eap-rhel.sh to make it compatible with Suse.

  • Replace /etc/init.d/functions with /etc/rc.status
  • Replace success with rc_status -v

With JBoss zip install, you will have init script jboss-eap-rhel.sh located under INSTALL_PATH/bin/init.d This is init script which won’t be useful in latest Suse versions since they follow LSB format. So we need to make it work with LSB and here is how to do it.

Copy service configuration file and service init script from the installation directory to respective system directories –

root@kerneltalks # cp INSTALL_PATH/bin/init.d/jboss-eap.conf /etc/default
root@kerneltalks # cp INSTALL_PATH/bin/init.d/jboss-eap-rhel.sh /etc/init.d/jboss-eap
root@kerneltalks # chmod +x /etc/init.d/jboss-eap

Please note that while coping over file we trimmed rhel from its name since it does not make sense to keep that name on the SUSE system! It will also alter the next command as well.


Adding it as a service

root@kerneltalks # chkconfig --add jboss-eap

Till this point, its the same process as RedHat mentioned in its tutorial. Now, if you try to start service it won’t. It will throw below error :

root@kerneltalks # service jboss-eap start
jboss-eap.sh is neither service nor target!?

Import service in sytemd

Now we need to get this service into systemd. To do that, You need to add below block on top of /etc/init.d/jboss-eap.sh . Make sure you edit it exactly since its an LSB compliant format read by the system. This needs to go below the shell opening line of script !/bin/sh and before the rest of the script.

### BEGIN INIT INFO
# Provides:          jboss-eap
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: jboss eap service
# Description:       jboss eap server for suse linux
### END INIT INFO

You are almost there! Import the service into systemd using below command –

root@kerneltalks # systemctl enable jboss-eap
jboss-eap.service is not a native service, redirecting to systemd-sysv-install
Executing /usr/lib/systemd/systemd-sysv-install enable jboss-eap

Now your service is available in systemctl to control. You can control service using commands like systemctl start jboss-eap, systemctl stop jboss-eap, systemctl status jboss-eap

root@kerneltalks # systemctl start jboss-eap
● jboss-eap-rhel.service - LSB: jboss eap service
   Loaded: loaded (/etc/init.d/jboss-eap-rhel.sh; bad; vendor preset: disabled)
   Active: active (running) since Thu 2019-06-20 1:23:23 IST; 10s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 10625 ExecStart=/etc/init.d/jboss-eap-rhel.sh start (code=exited, status=0/SUCCESS)
 Main PID: 12346 (java)
......

You have configured Jboss eap to run as service in Suse Linux.

⇠ Previous article
How to start, stop and reload postfix
Next article ⇢
SUSE Manager 4 Setup Configuration

Related stuff:

  • 5 steps guide for SMTP configuration in Linux
  • How to do safe and graceful Measureware service restart in HPUX
  • Build Syslog server in Linux for centralized log management
  • 6 ways to manage service startups using chkconfig in Linux
  • How to restart service in Linux
  • Linux scheduler: Cron, At jobs
  • How to change your shell prompt to fancy one instantly
  • 4 steps guide for SMTP configuration in HPUX
  • What are the huge pages in Linux?
  • How to restart NFS in HPUX
  • What is umask value? How to set it up?

Filed Under: System services Tagged With: configure service in suse, jboss eap as service

If you like my tutorials and if they helped you in any way, then

  • Consider buying me a cup of coffee via paypal!
  • Subscribe to our newsletter here!
  • Like KernelTalks Facebook page.
  • Follow us on Twitter.
  • Add our RSS feed to your feed reader.

Share Your Comments & Feedback: Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get fresh content from KernelTalks

  • Email
  • Facebook
  • RSS
  • Twitter

Get Linux & Unix stuff right into your mailbox. Subscribe now!

* indicates required

This work is licensed under a CC-BY-NC license · Privacy Policy
© Copyright 2016-2023 KernelTalks · All Rights Reserved.
The content is copyrighted to Shrikant Lavhate & can not be reproduced either online or offline without prior permission.