Bug 206853 - [PATCH] www/tomcat6: use procstat instead of jps to check status of process
Summary: [PATCH] www/tomcat6: use procstat instead of jps to check status of process
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
Keywords: easy, needs-qa, patch
Depends on:
Reported: 2016-02-02 16:33 UTC by Michael Zhilin
Modified: 2016-03-14 15:33 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (ale)
koobs: merge-quarterly?

SVN diff file (851 bytes, patch)
2016-02-02 16:33 UTC, Michael Zhilin
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Zhilin 2016-02-02 16:33:55 UTC
Created attachment 166442 [details]
SVN diff file


The patch changes only start/stop script. Now script tomcat6 uses jps to check if process is running or not. But jps makes a lot of actions with running java machines (at least perf attaching) and sometimes can fail if remote process is busy. So it's better to use procstat because it doesn't touch running processes. 

It works for me. Patch is very-very simple, so there is no impact on build processes, that's why I'm not attaching testport & portlint outputs. Please let me know it they are required.

Please review it!

Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2016-03-04 14:42:32 UTC
Comment on attachment 166442 [details]
SVN diff file

Maintainer timeout (1 month), implicit approval

Open to take
Comment 2 Michael Zhilin 2016-03-04 14:48:36 UTC
This patch fixes specific cases:
1) If "tomcat60_user" is specified in rc.conf and different from root, service stop/start doesn't work.
2) If tomcat is hang (for instance, infinite fullgc), jps can't lookup PID of tomcat, so service stop doesn't work.

Comment 3 commit-hook freebsd_committer 2016-03-14 15:32:52 UTC
A commit references this bug:

Author: feld
Date: Mon Mar 14 15:31:56 UTC 2016
New revision: 411095
URL: https://svnweb.freebsd.org/changeset/ports/411095

  www/tomcat6: Make rc script more reliable

  By using procstat instead of jps to check if the daemon is running we
  avoid deadlocks if the java process is hung.

  PR:		206853