Bug 207881

Summary: net/activemq: When running daemon script, activemq doesn't properly stop
Product: Ports & Packages Reporter: bwilliamson
Component: Individual Port(s)Assignee: Tobias Kortkamp <tobik>
Status: Closed FIXED    
Severity: Affects Only Me CC: bwilliamson, romain, w.schwarzenfeld
Priority: --- Flags: tobik: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
activemq daemon script
none
Change user to detect activemq process none

Description bwilliamson 2016-03-10 13:55:57 UTC
Created attachment 167965 [details]
activemq daemon script

When running daemon script, activemq doesn't properly stop.

Command:
/usr/local/etc/rc.d/activemq stop

Reports that script did not detect running activemq even though it is.

Adding start command appears to solve the issue.
Comment 1 Romain Tartière freebsd_committer freebsd_triage 2016-03-19 12:15:02 UTC
Created attachment 168383 [details]
Change user to detect activemq process

The rc.d script rely on jps(1) to detect the process, however on my system, running jps(1) as root produces:

# jps -l
39223 -- process information unavailable
71545 -- process information unavailable
72668 sun.tools.jps.Jps

Running jps(1) as the user activemq instead of root produce a better output:

# sudo -u activemq jps -l
72761 sun.tools.jps.Jps
71545 /usr/local/lib/activemq/bin/activemq.jar

A quick solution is to use sudo(1) to run jps(1) as the activemq user, but the maintainer may prefer to rework the detection code instead of adding a dependency?
Comment 2 Romain Tartière freebsd_committer freebsd_triage 2016-03-19 12:16:16 UTC
I'm running FreeBSD 10.3-PRERELEASE by the way.
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-03-25 15:30:20 UTC
A commit references this bug:

Author: tj
Date: Fri Mar 25 15:29:57 UTC 2016
New revision: 411851
URL: https://svnweb.freebsd.org/changeset/ports/411851

Log:
  Update to 5.13.2

  Changes: http://activemq.apache.org/activemq-5132-release.html

  Fix stop/status in rc script.

  PR:	207881

Changes:
  head/net/activemq/Makefile
  head/net/activemq/distinfo
  head/net/activemq/files/activemq.in
  head/net/activemq/pkg-plist
Comment 4 bwilliamson 2016-05-06 11:55:28 UTC
This is still an issue.  Recently installed ActiveMQ 5.13.2 and daemon will not stop properly and is always killed.  When killed, I have experienced corrupted kahadb and left over lock files which prevent next ActiveMQ instance from running properly.

OS is 10.3-RELEASE
Comment 5 Walter Schwarzenfeld freebsd_triage 2018-01-13 06:31:07 UTC
Is this still an issue?
Comment 6 Rene Ladan freebsd_committer freebsd_triage 2018-11-06 21:42:14 UTC
Maintainer reset.
Comment 7 commit-hook freebsd_committer freebsd_triage 2019-04-18 09:04:02 UTC
A commit references this bug:

Author: tobik
Date: Thu Apr 18 09:03:10 UTC 2019
New revision: 499241
URL: https://svnweb.freebsd.org/changeset/ports/499241

Log:
  net/activemq: Fix rc script stop command

  The stop command fails because it cannot connect to activemq, so
  the rc script currently always kills activemq which might lead to
  lost data, database corruption, left-over lock files, etc.  Run the
  stop command under the activemq user too like the jps command in
  activemq_check_pidfile() so that it can actually shutdown activemq.

  - While here fix log files location

  PR:		207881
  Reported by:	bwilliamson@bex.net

Changes:
  head/net/activemq/Makefile
  head/net/activemq/files/activemq.in
  head/net/activemq/files/patch-conf_log4j.properties
Comment 8 Tobias Kortkamp freebsd_committer freebsd_triage 2019-04-18 09:04:56 UTC
Should be fixed now, I hope.