Bug 1273093 - [GSS](6.4.z) EAP zip based init scripts doesn't detach jbossas process
[GSS](6.4.z) EAP zip based init scripts doesn't detach jbossas process
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Scripts and Commands (Show other bugs)
6.4.4
Unspecified Linux
medium Severity medium
: CR1
: EAP 6.4.13
Assigned To: Bartek Spyrko-Smietanko
Marek Kopecky
:
Depends On:
Blocks: eap6413-payload 1425754
  Show dependency treegraph
 
Reported: 2015-10-19 10:37 EDT by Tom Fonteyne
Modified: 2017-02-22 09:30 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
RHEL
Last Closed: 2017-02-03 11:43:18 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBEAP-3666 Major Closed EAP init scripts don't detach jbossas process 2017-10-13 07:28 EDT

  None (edit)
Description Tom Fonteyne 2015-10-19 10:37:50 EDT
The zip based install of EAP ships with:

  bin/init.d/jboss-as-domain.sh
  bin/init.d/jboss-as-standalone.sh

which allows them to be run as services on a RHEL and similar *NIX systems.

The scripts use the "/etc/init.d/functions" library which bring "daemon" to start programs. In our case to start the domain/standalone.sh scripts.

The intention is that these start in the background, but this fails.

Reproduce:
- create a new OS user "jbossadm"
- unzip EAP in his home directory
- copy bin/init.d/jboss-as.conf to /etc/jboss-as/
  configure it with:
     JBOSS_HOME=/home/jbossadm/jboss-eap-6.4
     JBOSS_USER=jbossas
     JBOSS_CONSOLE_LOG=/home/jbossadm/console.log

- copy bin/init/jboss-as-domain.sh  to /etc/init.d
- become su, and start with:
     /etc/init.d/jboss-as-domain.sh start

-run:   ps axfo pid,ppid,user,command | grep jboss

 2328     1 root     /bin/sh /etc/init.d/jboss-as-domain.sh start
 2332  2328 root      \_ runuser -s /bin/bash jbossadm -c ulimit -S -c 0 >/dev/null 2>&1 ; LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=/var/run/jboss-as/jboss-as-domain.pid /opt/jboss/current/bin/domain.sh --domain-config=domain.xml --host-config=host.xml
 2333  2332 jbossadm      \_ bash -c ulimit -S -c 0 >/dev/null 2>&1 ; LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=/var/run/jboss-as/jboss-as-domain.pid /opt/jboss/current/bin/domain.sh --domain-config=domain.xml --host-config=host.xml
 2334  2333 jbossadm          \_ /bin/sh /opt/jboss/current/bin/domain.sh --domain-config=domain.xml --host-config=host.xml
 2422  2334 jbossadm              \_ /opt/java/current/bin/java -D[Process Controller] -server -Xms64m -Xmx512m […]

Expectation: "domain.sh" to become detached and have "1" as its parent.

ISSUE: line 94 is currently:

daemon --user $JBOSS_USER LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=$JBOSS_PIDFILE $JBOSS_SCRIPT --domain-config=$JBOSS_DOMAIN_CONFIG --host-config=$JBOSS_HOST_CONFIG 2>&1 >$JBOSS_CONSOLE_LOG &

FIX: should be:

daemon --user $JBOSS_USER LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=$JBOSS_PIDFILE "$JBOSS_SCRIPT --domain-config=$JBOSS_DOMAIN_CONFIG --host-config=$JBOSS_HOST_CONFIG &" 2>&1 >$JBOSS_CONSOLE_LOG

e.g. the "&" needs to be bundled with the actual script -> so add quotes and move the & insude the quotes.

The same is true for the "bin/init.djboss-as-standalone.sh" script:

line 90 should become:

daemon --user $JBOSS_USER LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=$JBOSS_PIDFILE "$JBOSS_SCRIPT -c $JBOSS_CONFIG &" > $JBOSS_CONSOLE_LOG 2>&1


Also: the same remark is valid for lines 96 respectively line 94 where "su" is used instead of "daemon" if "/etc/init.d/functions" is not available
Comment 4 Mike McCune 2016-03-28 18:21:53 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 6 JBoss JIRA Server 2016-06-14 07:38:10 EDT
Jiri Pallich <jpallich@redhat.com> updated the status of jira JBEAP-3666 to Closed
Comment 7 Ivo Hradek 2017-01-03 04:50:54 EST
Verified with EAP 6.4.13.CP.CR1;
Comment 8 Petr Penicka 2017-02-03 11:43:18 EST
Released with EAP 6.4.13 on Feb 02 2017.

Note You need to log in before you can comment on or make changes to this bug.