Bug 207881 - net/activemq: When running daemon script, activemq doesn't properly stop
Summary: net/activemq: When running daemon script, activemq doesn't properly stop
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
Depends on:
Reported: 2016-03-10 13:55 UTC by bwilliamson
Modified: 2019-04-18 09:04 UTC (History)
3 users (show)

See Also:
tobik: maintainer-feedback+

activemq daemon script (892 bytes, patch)
2016-03-10 13:55 UTC, bwilliamson
no flags Details | Diff
Change user to detect activemq process (385 bytes, patch)
2016-03-19 12:15 UTC, Romain Tartière
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.

/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 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 2016-03-19 12:16:16 UTC
I'm running FreeBSD 10.3-PRERELEASE by the way.
Comment 3 commit-hook freebsd_committer 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

  Update to 5.13.2

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

  Fix stop/status in rc script.

  PR:	207881

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 2018-11-06 21:42:14 UTC
Maintainer reset.
Comment 7 commit-hook freebsd_committer 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

  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

Comment 8 Tobias Kortkamp freebsd_committer 2019-04-18 09:04:56 UTC
Should be fixed now, I hope.