Bug 140015 - Unable to stop www/tomcat6 from rc.d
Summary: Unable to stop www/tomcat6 from rc.d
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Dupre
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-27 13:30 UTC by christer.solskogen
Modified: 2010-03-01 15:40 UTC (History)
0 users

See Also:


Attachments
patch.tomcat6 (330 bytes, text/x-patch)
2009-12-02 13:20 UTC, Roger Gujord
no flags Details
patch-2.diff (777 bytes, patch)
2009-12-02 18:55 UTC, Roger Gujord
no flags Details | Diff
patch-3.diff (1.58 KB, patch)
2009-12-02 22:32 UTC, Roger Gujord
no flags Details | Diff
tomcat6 (4.49 KB, application/octet-stream)
2009-12-02 23:27 UTC, Roger Gujord
no flags Details
file.dat (15 bytes, text/plain; charset=us-ascii)
2009-12-02 23:27 UTC, Roger Gujord
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description christer.solskogen 2009-10-27 13:30:01 UTC
The rc.d script provided by the www/tomcat6 port don't work as expected. It starts alright, but it's not able to stop the java process.

Using:
diablo-jdk-1.6.0.07.02_6
tomcat-6.0.20_1

How-To-Repeat: How to repeat:

Install tomcat6 from ports, and add tomcat60_enable="YES" to rc.conf.

tomcat# /usr/local/etc/rc.d/tomcat6 start
Starting tomcat60.
tomcat# /usr/local/etc/rc.d/tomcat6 stop
tomcat60 not running? (check /var/run/tomcat60.pid).

tomcat# ps waux | grep java
www   1681  0.0  1.0 1247408 80528  ??  IsJ   1:25PM   0:02.52 /usr/local/diablo-jdk1.6.0/bin/java -Djava.endorsed.dirs=/usr/local/apache-tomcat-6.0/endorsed -classpath /usr/local/ap
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-10-27 15:01:32 UTC
Responsible Changed
From-To: freebsd-bugs->nemoliu

Make this a ports PR, fix synopsis, and assign.
Comment 2 Roger Gujord 2009-12-02 13:20:32 UTC
Patch attached to fix /usr/local/etc/rc.d/tomcat6
--
Roger Gujord
Comment 3 christer.solskogen 2009-12-02 13:26:40 UTC
2009/12/2 Roger Gujord <roger@gujord.com>:
> Patch attached to fix /usr/local/etc/rc.d/tomcat6
> --

Still no go, I'm afraid

-- 
chs,
Comment 4 Roger Gujord 2009-12-02 18:55:49 UTC
New patch attached.
--
Roger Gujord
Comment 5 christer.solskogen 2009-12-02 19:26:34 UTC
On Wed, Dec 2, 2009 at 7:55 PM, Roger Gujord <roger@gujord.com> wrote:
> New patch attached.

I still get tomcat60 not running? (check /var/run/tomcat60.pid)
But why not use tomcats own shutdown.sh (and startup.sh) instead of
killing the pid the most fantastic way :) (using tomcat6s own
startup.sh and shutdown.sh works)


-- 
chs,
Comment 6 Roger Gujord 2009-12-02 19:28:25 UTC
Sorry... the latest patch is just some rubbish and will most likely not =
help at all.

You may also want to put the following in your /etc/rc.conf:

tomcat60_enable=3D"YES"
tomcat60_user=3D"www"
tomcat60_java_version=3D"1.6"

Check that your /var/run/tomcat6.pid has the correct ownership and that =
your tomcat user can read and write to it.

The chmod changes (as in the first patch) in /usr/local/etc/rc.d/tomcat6 =
solved the problem for me.

--
Roger Gujord=
Comment 7 christer.solskogen 2009-12-02 19:36:11 UTC
On Wed, Dec 2, 2009 at 8:28 PM, Roger Gujord <roger@gujord.com> wrote:
> Sorry... the latest patch is just some rubbish and will most likely not help at all.
>
> You may also want to put the following in your /etc/rc.conf:
>
> tomcat60_enable="YES"
> tomcat60_user="www"
> tomcat60_java_version="1.6"
>
> Check that your /var/run/tomcat6.pid has the correct ownership and that your tomcat user can read and write to it.
>
> The chmod changes (as in the first patch) in /usr/local/etc/rc.d/tomcat6 solved the problem for me.
>

But not for me :(
tomcat# /usr/local/etc/rc.d/tomcat6 start
Starting tomcat60.
tomcat# /usr/local/etc/rc.d/tomcat6 stop
tomcat60 not running? (check /var/run/tomcat60.pid).
tomcat# ls -la /var/run/tomcat60.pid
-rw-r--r--  1 www  wheel  5 Dec  2 20:34 /var/run/tomcat60.pid
tomcat# cat /var/run/tomcat60.pid
39953
tomcat# ps aux | grep tom
www  39953  0.0  0.9 1421152 72240  ??  IsJ   8:34PM   0:02.06
/usr/local/diablo-jdk1.6.0/bin/java -XX:MaxPermSize=256m
-Djava.endorsed.dirs=/usr/local/apache-tomcat-6.0/endorsed -cl



-- 
chs,
Comment 8 Roger Gujord 2009-12-02 22:32:45 UTC
The attached patch should solve the problem.
Thank you in advance for testing and reporting back :-)
--
Roger Gujord
Comment 9 christer.solskogen 2009-12-02 22:36:18 UTC
On Wed, Dec 2, 2009 at 11:32 PM, Roger Gujord <roger@gujord.com> wrote:
> The attached patch should solve the problem.
> Thank you in advance for testing and reporting back :-)

I was unable to use that patch.

tomcat# patch -p0 < patch
Hmm...  Looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|*** ../tomcat6 2009-12-02 13:08:51.000000000 +0000
|--- tomcat6    2009-12-02 22:20:57.000000000 +0000
--------------------------
Patching file tomcat6 using Plan A...
Hunk #1 failed at 116.
1 out of 1 hunks failed--saving rejects to tomcat6.rej
Hmm...  Ignoring the trailing garbage.
done


-- 
chs,
Comment 10 Roger Gujord 2009-12-02 23:27:23 UTC
Make sure you patch against the clean orginal file.
Attached you'll find my "/usr/local/etc/rc.d/tomcat6" file with the patched already applied.
Thanks again for testing :-)
Comment 11 christer.solskogen 2009-12-03 12:07:17 UTC
On Thu, Dec 3, 2009 at 12:27 AM, Roger Gujord <roger@gujord.com> wrote:
> Make sure you patch against the clean orginal file.
> Attached you'll find my "/usr/local/etc/rc.d/tomcat6" file with the patched already applied.
> Thanks again for testing :-)
>

Much better, this one works! :) Thanks for your time.

-- 
chs
Comment 12 Mark Linimon freebsd_committer freebsd_triage 2009-12-16 10:25:27 UTC
Responsible Changed
From-To: nemoliu->freebsd-ports-bus

Maintainer was reset due to inactivity.
Comment 13 Mark Linimon freebsd_committer freebsd_triage 2009-12-16 10:27:33 UTC
Responsible Changed
From-To: freebsd-ports-bus->freebsd-ports-bugs

Don't laugh, the new keyboard is on order.
Comment 14 Mark Linimon freebsd_committer freebsd_triage 2009-12-17 08:04:04 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to new maintainer.
Comment 15 Alex Dupre freebsd_committer freebsd_triage 2009-12-17 10:16:01 UTC
Use the original rc script and set rc_debug="YES". Then report to me the
output of the stop command.

-- 
Alex Dupre
Comment 16 christer.solskogen 2009-12-17 11:30:52 UTC
On Thu, Dec 17, 2009 at 11:16 AM, Alex Dupre <ale@freebsd.org> wrote:
> Use the original rc script and set rc_debug="YES". Then report to me the
> output of the stop command.
>

/usr/local/etc/rc.d/tomcat6: DEBUG: checkyesno: tomcat60_enable is set to YES.
/usr/local/etc/rc.d/tomcat6: DEBUG: run_rc_command: start_precmd: pid_touch
Starting tomcat60.
/usr/local/etc/rc.d/tomcat6: DEBUG: run_rc_command: doit: su -m www -c
'sh -c "/usr/sbin/daemon -p /var/run/tomcat60.pid /usr/local/bin/java
          -Djava.endorsed.dirs=/usr/local/apache-tomcat-6.0/endorsed
-classpath /usr/local/apache-tomcat-6.0/bin/bootstrap.jar:
-Dcatalina.base=/usr/local/apache-tomcat-6.0
-Dcatalina.home=/usr/local/apache-tomcat-6.0
-Djava.io.tmpdir=/usr/local/apache-tomcat-6.0/temp
org.apache.catalina.startup.Bootstrap start  >>
/usr/local/apache-tomcat-6.0/logs/stdout.log    2>>
/usr/local/apache-tomcat-6.0/logs/stderr.log  "'

tomcat# ps waux | grep java
www  34257 54.9  0.8 1421152 69292  ??  SsJ  12:29PM   0:02.12
/usr/local/diablo-jdk1.6.0/bin/java -XX:MaxPermSize=256m
-Djava.endorsed.dirs=/usr/local/apache-tomcat-6.0/endorsed -classpath
/usr/local/apach
root 34345  0.0  0.0  8004  1092   7  RL+J 12:29PM   0:00.00 grep java

tomcat# /usr/local/etc/rc.d/tomcat6 stop
/usr/local/etc/rc.d/tomcat6: DEBUG: checkyesno: tomcat60_enable is set to YES.
/usr/local/etc/rc.d/tomcat6: DEBUG: run_rc_command: doit: tomcat60_stop
tomcat60 not running? (check /var/run/tomcat60.pid).

cat /var/run/tomcat60.pid
34257



-- 
chs,
Comment 17 Eric Kraußer 2009-12-31 14:44:14 UTC
/usr/local/etc/rc.d/tomcat6:
...
procname="java"
...
tomcat60_stop() {
         rc_pid=$(check_pidfile $pidfile $procname)
...


The command "check_pidfile" (from /etc/rc.subr) doesn't find "java" in 
the list of processes.
If I change procname="java" to
procname="/usr/local/diablo-jdk1.6.0/bin/java"
the script shuts tomcat down as expected.
Sure, no solution, but I hope this helps to solve this nasty problem.
The pidfile with it's permissions seems fine anyway.

Eric
Comment 18 solskogen 2010-03-01 14:30:59 UTC
Anyone up for commiting the patch?
Comment 19 dfilter service freebsd_committer freebsd_triage 2010-03-01 15:37:01 UTC
ale         2010-03-01 15:36:47 UTC

  FreeBSD ports repository

  Modified files:
    www/tomcat6          Makefile distinfo 
    www/tomcat6/files    tomcat6.sh.in 
  Log:
  - Update to 6.0.24 release [1]
  - Fix rc.d stop script [2]
  
  PR:             ports/144274 [1], ports/140015 [2]
  Submitted by:   wen [1], Christer Solskogen <christer.solskogen@gmail.com> [2]
  Feature safe:   yes
  
  Revision  Changes    Path
  1.55      +1 -2      ports/www/tomcat6/Makefile
  1.26      +3 -3      ports/www/tomcat6/distinfo
  1.6       +27 -9     ports/www/tomcat6/files/tomcat6.sh.in
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 20 Alex Dupre freebsd_committer freebsd_triage 2010-03-01 15:38:31 UTC
State Changed
From-To: open->closed

Should be fixed now.