Customize WildFly Startup Wrapper: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
=Overview=
=Overview=


This procedure is used for both System V and <tt>systemd</tt>, as both systems use the same wrapper scripts. For context, see [[Start WildFly as a System V Service on Linux#Customize_the_WildFly_Startup_Wrapper|Start WildFly as a System V Service on Linux]] and [[]].
This procedure is used for both System V and <tt>systemd</tt>, as both systems use the same wrapper scripts. For context, see [[Start WildFly as a System V Service on Linux#Customize_the_WildFly_Startup_Wrapper|Start WildFly as a System V Service on Linux]] and [[Start WildFly as a systemd Service on Linux#Customize_the_WildFly_Startup_Wrapper]].


=Configure the Startup Script from <tt>init.d</tt>=
=Configure the Startup Script from <tt>init.d</tt>=

Revision as of 07:54, 16 February 2016

Overview

This procedure is used for both System V and systemd, as both systems use the same wrapper scripts. For context, see Start WildFly as a System V Service on Linux and Start WildFly as a systemd Service on Linux#Customize_the_WildFly_Startup_Wrapper.

Configure the Startup Script from init.d

Add at the top of the file:

JBOSS_HOME=/home/eap/EAP-6.4.0
JBOSS_USER=eap
#
# The amount of time to wait for startup
#
STARTUP_WAIT=30
#
# The amount of time to wait for shutdown
#
SHUTDOWN_WAIT=30
#
# Location to keep the console log
#
JBOSS_CONSOLE_LOG=${JBOSS_HOME}/domain/log/console.log
[ ! -d ${JBOSS_HOME}/domain/log ] && { mkdir -p ${JBOSS_HOME}/domain/log; chown ${JBOSS_USER} ${JBOSS_HOME}/domain/log; chmod a+rx ${JBOSS_HOME}/domain/log; }

Domain Controller High Availability Considerations

If you're building a host controller that is expected to fail over among multiple HA domain controllers, increase the STARTUP_WAIT (see HA Domain Controller Failover Process for details).

Backup Domain Controller Considerations

If you're building a backup domain controller you will need to add this into jboss-host-controller}:

JBOSS_BACKUP_DOMAIN_CONTROLLER=true

and then add this to the start line:

  ...
  local backup_option
  ${JBOSS_BACKUP_DOMAIN_CONTROLLER} && backup_option="--backup"

  if [ ! -z "$JBOSS_USER" ]; then
    if [ -r /etc/rc.d/init.d/functions ]; then
      daemon  [...] --host-config=$JBOSS_HOST_CONFIG ${backup_option} [...]
    else
      su [...] --host-config=$JBOSS_HOST_CONFIG ${backup_option}" [...] 
    fi
  fi
  ...

Optional

If you deleted domain.xml, you will also need to set:

JBOSS_DOMAIN_CONFIG=domain.cached-remote.xml

but this is undocumented, so it's probably best NOT to remove domain.xml and leave JBOSS_DOMAIN_CONFIG definition in jboss-host-controller alone.

Permissions

Then adjust permissions:

chmod a+rx ./jboss
chmod a+rx ./jboss-host-controller