Bug 1273093 - [GSS](6.4.z) EAP zip based init scripts doesn't detach jbossas process
Summary: [GSS](6.4.z) EAP zip based init scripts doesn't detach jbossas process
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Scripts and Commands
Version: 6.4.4
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: CR1
: EAP 6.4.13
Assignee: Bartek Spyrko-Smietanko
QA Contact: Marek Kopecky
URL:
Whiteboard:
Depends On:
Blocks: eap6413-payload 1425754
TreeView+ depends on / blocked
 
Reported: 2015-10-19 14:37 UTC by Tom Fonteyne
Modified: 2019-08-15 05:42 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
RHEL
Last Closed: 2017-02-03 16:43:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEAP-3666 0 Major Closed EAP init scripts don't detach jbossas process 2018-06-14 22:56:47 UTC

Description Tom Fonteyne 2015-10-19 14:37:50 UTC
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 22:21:53 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 6 JBoss JIRA Server 2016-06-14 11:38:10 UTC
Jiri Pallich <jpallich> updated the status of jira JBEAP-3666 to Closed

Comment 7 Ivo Hradek 2017-01-03 09:50:54 UTC
Verified with EAP 6.4.13.CP.CR1;

Comment 8 Petr Penicka 2017-02-03 16:43:18 UTC
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.