ports/116729: [PATCH] www/tomcat{41, 55, 6}: fix 2 wrapper script problems

Alejandro Pulver alepulver at FreeBSD.org
Sat Sep 29 05:50:09 UTC 2007


>Number:         116729
>Category:       ports
>Synopsis:       [PATCH] www/tomcat{41,55,6}: fix 2 wrapper script problems
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 29 05:50:08 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Alejandro Pulver
>Release:        FreeBSD 6.2-RELEASE i386
>Organization:
>Environment:


System: FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007
    root at dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP



>Description:


When I was taking code from the wrapper script for a new port (databases/exist), I saw 2 problems in it:

1) When the daemon is not running, 'procname' is empty and the call to check_pidfile fails.
2) The use of *$procname* causes shell expansion, and together with the previous one, generates an error because ** matches every file in the directory.

Note: these errors do not stop the script from working, but might produce strange results (for example the output) in some situations.


>How-To-Repeat:


Run when the daemon is not started:

${PREFIX}/etc/rc.d/tomcat66.sh forcestop

Apply the patch, and run again.


>Fix:


--- tomcat6.diff begins here ---
Index: tomcat6/files/tomcat6.sh.in
===================================================================
RCS file: /home/pcvs/ports/www/tomcat6/files/tomcat6.sh.in,v
retrieving revision 1.1
diff -u -r1.1 tomcat6.sh.in
--- tomcat6/files/tomcat6.sh.in	18 Feb 2007 12:56:16 -0000	1.1
+++ tomcat6/files/tomcat6.sh.in	29 Sep 2007 05:39:25 -0000
@@ -112,6 +112,9 @@
     procname=`ps -o ucomm= $rc_pid`
   fi
 fi
+if [ -z "$procname" ]; then
+  procname=nonexistent
+fi
 
 required_files="${tomcat%%TOMCAT_VERSION%%_catalina_home}/conf/server.xml"
 
@@ -128,7 +131,7 @@
 }
 
 tomcat%%TOMCAT_VERSION%%_stop() {
-	rc_pid=$(check_pidfile $pidfile *$procname*)
+	rc_pid=$(check_pidfile $pidfile $procname)
 
 	if [ -z "$rc_pid" ]; then
 		[ -n "$rc_fast" ] && return 0
--- tomcat6.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list