- use lsb_release instead of lsb-release to get the distributor
6.0.18-5 - fix initscript messages on Mandriva Linux - fix help message in initscript 6.0.18-4 - redefine %%_initrddir for FHS-compliance - make initscript LSB-complaint 6.0.18-3 - fix status in initscript 6.0.18-2 - remove initscripts and /sbin/service requirement - call initscript directly without using /sbin/service - require /sbin/chkconfig instead of chkconfig - remove chkconfig requirement from packages that don't require it
This commit is contained in:
parent
f2e782275f
commit
41ff5cd14d
@ -18,8 +18,16 @@
|
|||||||
# - heavily rewritten by Deepak Bhole and Jason Corley
|
# - heavily rewritten by Deepak Bhole and Jason Corley
|
||||||
#
|
#
|
||||||
|
|
||||||
# Source function library.
|
## Source function library.
|
||||||
. /etc/rc.d/init.d/functions
|
#. /etc/rc.d/init.d/functions
|
||||||
|
# Source LSB function library.
|
||||||
|
if [ -r /lib/lsb/init-functions ]; then
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DISTRIB_ID=`lsb_release -i -s 2>/dev/null`
|
||||||
|
|
||||||
NAME="$(basename $0)"
|
NAME="$(basename $0)"
|
||||||
unset ISBOOT
|
unset ISBOOT
|
||||||
@ -137,9 +145,12 @@ function start() {
|
|||||||
if [ -f "/var/lock/subsys/${NAME}" ] ; then
|
if [ -f "/var/lock/subsys/${NAME}" ] ; then
|
||||||
if [ -f "/var/run/${NAME}.pid" ]; then
|
if [ -f "/var/run/${NAME}.pid" ]; then
|
||||||
read kpid < /var/run/${NAME}.pid
|
read kpid < /var/run/${NAME}.pid
|
||||||
if checkpid $kpid 2>&1; then
|
# if checkpid $kpid 2>&1; then
|
||||||
echo_success
|
if [ -d "/proc/${kpid}" ]; then
|
||||||
echo
|
log_success_msg
|
||||||
|
if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then
|
||||||
|
echo
|
||||||
|
fi
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -169,12 +180,14 @@ function start() {
|
|||||||
fi
|
fi
|
||||||
RETVAL="$?"
|
RETVAL="$?"
|
||||||
if [ "$RETVAL" -eq 0 ]; then
|
if [ "$RETVAL" -eq 0 ]; then
|
||||||
echo_success
|
log_success_msg
|
||||||
touch /var/lock/subsys/${NAME}
|
touch /var/lock/subsys/${NAME}
|
||||||
else
|
else
|
||||||
echo_failure
|
log_failure_msg
|
||||||
|
fi
|
||||||
|
if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then
|
||||||
|
echo
|
||||||
fi
|
fi
|
||||||
echo
|
|
||||||
return $RETVAL
|
return $RETVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,16 +216,18 @@ function stop() {
|
|||||||
fi
|
fi
|
||||||
kill -9 $kpid
|
kill -9 $kpid
|
||||||
fi
|
fi
|
||||||
echo_success
|
log_success_msg
|
||||||
fi
|
fi
|
||||||
rm -f /var/lock/subsys/${NAME} /var/run/${NAME}.pid
|
rm -f /var/lock/subsys/${NAME} /var/run/${NAME}.pid
|
||||||
else
|
else
|
||||||
echo_failure
|
log_failure_msg
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo_success
|
log_success_msg
|
||||||
|
fi
|
||||||
|
if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then
|
||||||
|
echo
|
||||||
fi
|
fi
|
||||||
echo
|
|
||||||
return $RETVAL
|
return $RETVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,13 +260,20 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
if [ -f "/var/run/${NAME}.pid" ]; then
|
if [ -f "/var/run/${NAME}.pid" ]; then
|
||||||
status ${NAME}
|
# status ${NAME}
|
||||||
RETVAL="$?"
|
# RETVAL="$?"
|
||||||
|
read kpid < /var/run/${NAME}.pid
|
||||||
|
if [ -d "/proc/${kpid}" ]; then
|
||||||
|
echo "${NAME} (pid ${kpid}) is running..."
|
||||||
|
RETVAL="0"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
pid="$(/usr/bin/pgrep -d , -u tomcat -G tomcat java)"
|
pid="$(/usr/bin/pgrep -d , -u ${TOMCAT_USER} -G ${TOMCAT_USER} java)"
|
||||||
if [ -z "$pid" ]; then
|
if [ -z "$pid" ]; then
|
||||||
status ${NAME}
|
# status ${NAME}
|
||||||
RETVAL="$?"
|
# RETVAL="$?"
|
||||||
|
echo "${NAME} is stopped"
|
||||||
|
RETVAL="3"
|
||||||
else
|
else
|
||||||
echo "${NAME} (pid $pid) is running..."
|
echo "${NAME} (pid $pid) is running..."
|
||||||
RETVAL="0"
|
RETVAL="0"
|
||||||
@ -262,7 +284,7 @@ case "$1" in
|
|||||||
${TOMCAT_SCRIPT} version
|
${TOMCAT_SCRIPT} version
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo -n "Usage: $0 {start|stop|restart|condrestart|try-restart|reload|force-reload|status|version}"
|
echo "Usage: $0 {start|stop|restart|condrestart|try-restart|reload|force-reload|status|version}"
|
||||||
RETVAL="2"
|
RETVAL="2"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
44
tomcat6.spec
44
tomcat6.spec
@ -47,11 +47,12 @@
|
|||||||
%define logdir %{_var}/log/%{name}
|
%define logdir %{_var}/log/%{name}
|
||||||
%define tempdir %{_var}/cache/%{name}/temp
|
%define tempdir %{_var}/cache/%{name}/temp
|
||||||
%define workdir %{_var}/cache/%{name}/work
|
%define workdir %{_var}/cache/%{name}/work
|
||||||
|
%define _initrddir %{_sysconfdir}/init.d
|
||||||
|
|
||||||
Name: tomcat6
|
Name: tomcat6
|
||||||
Epoch: 0
|
Epoch: 0
|
||||||
Version: %{major_version}.%{minor_version}.%{micro_version}
|
Version: %{major_version}.%{minor_version}.%{micro_version}
|
||||||
Release: 1.1%{?dist}
|
Release: 6.1%{?dist}
|
||||||
Summary: Apache Servlet/JSP Engine, RI for Servlet %{servletspec}/JSP %{jspspec} API
|
Summary: Apache Servlet/JSP Engine, RI for Servlet %{servletspec}/JSP %{jspspec} API
|
||||||
|
|
||||||
Group: Networking/Daemons
|
Group: Networking/Daemons
|
||||||
@ -76,20 +77,20 @@ BuildRequires: ecj
|
|||||||
BuildRequires: findutils
|
BuildRequires: findutils
|
||||||
BuildRequires: jakarta-commons-collections
|
BuildRequires: jakarta-commons-collections
|
||||||
BuildRequires: jakarta-commons-daemon
|
BuildRequires: jakarta-commons-daemon
|
||||||
BuildRequires: java-1.6.0-devel
|
BuildRequires: java-devel
|
||||||
BuildRequires: jpackage-utils >= 0:1.7.0
|
BuildRequires: jpackage-utils >= 0:1.7.0
|
||||||
BuildRequires: junit
|
BuildRequires: junit
|
||||||
Requires(pre): shadow-utils
|
Requires(pre): shadow-utils
|
||||||
Requires(pre): shadow-utils
|
Requires(pre): shadow-utils
|
||||||
Requires: jakarta-commons-daemon
|
Requires: jakarta-commons-daemon
|
||||||
Requires: jakarta-commons-logging
|
Requires: jakarta-commons-logging
|
||||||
Requires: java-1.6.0
|
Requires: java
|
||||||
Requires: procps
|
Requires: procps
|
||||||
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
|
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
|
||||||
Requires(post): chkconfig
|
Requires(post): /sbin/chkconfig
|
||||||
Requires(preun): chkconfig
|
Requires(preun): /sbin/chkconfig
|
||||||
# for /sbin/service
|
Requires(post): /lib/lsb/init-functions
|
||||||
Requires(preun): initscripts
|
Requires(preun): /lib/lsb/init-functions
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Tomcat is the servlet container that is used in the official Reference
|
Tomcat is the servlet container that is used in the official Reference
|
||||||
@ -130,8 +131,6 @@ Summary: Apache Tomcat JSP API implementation classes
|
|||||||
Provides: jsp = %{jspspec}
|
Provides: jsp = %{jspspec}
|
||||||
Provides: jsp21
|
Provides: jsp21
|
||||||
Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
|
Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
|
||||||
Requires(post): chkconfig
|
|
||||||
Requires(postun): chkconfig
|
|
||||||
|
|
||||||
%description jsp-%{jspspec}-api
|
%description jsp-%{jspspec}-api
|
||||||
Apache Tomcat JSP API implementation classes.
|
Apache Tomcat JSP API implementation classes.
|
||||||
@ -142,6 +141,7 @@ Summary: Libraries needed to run the Tomcat Web container
|
|||||||
Requires: %{name}-jsp-%{jspspec}-api = %{epoch}:%{version}-%{release}
|
Requires: %{name}-jsp-%{jspspec}-api = %{epoch}:%{version}-%{release}
|
||||||
Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
|
Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
|
||||||
Requires(post): ecj
|
Requires(post): ecj
|
||||||
|
Requires(post): %{_javadir}/ecj.jar
|
||||||
Requires(post): jakarta-commons-collections-tomcat5
|
Requires(post): jakarta-commons-collections-tomcat5
|
||||||
Requires(post): jakarta-commons-dbcp-tomcat5
|
Requires(post): jakarta-commons-dbcp-tomcat5
|
||||||
Requires(post): jakarta-commons-pool-tomcat5
|
Requires(post): jakarta-commons-pool-tomcat5
|
||||||
@ -156,8 +156,6 @@ Summary: Apache Tomcat Servlet API implementation classes
|
|||||||
Provides: servlet = %{servletspec}
|
Provides: servlet = %{servletspec}
|
||||||
Provides: servlet6
|
Provides: servlet6
|
||||||
Provides: servlet25
|
Provides: servlet25
|
||||||
Requires(post): chkconfig
|
|
||||||
Requires(postun): chkconfig
|
|
||||||
|
|
||||||
%description servlet-%{servletspec}-api
|
%description servlet-%{servletspec}-api
|
||||||
Apache Tomcat Servlet API implementation classes.
|
Apache Tomcat Servlet API implementation classes.
|
||||||
@ -352,7 +350,7 @@ popd
|
|||||||
# clean tempdir and workdir on removal or upgrade
|
# clean tempdir and workdir on removal or upgrade
|
||||||
%{__rm} -rf %{workdir}/* %{tempdir}/*
|
%{__rm} -rf %{workdir}/* %{tempdir}/*
|
||||||
if [ "$1" = "0" ]; then
|
if [ "$1" = "0" ]; then
|
||||||
/sbin/service %{name} stop >/dev/null 2>&1
|
%{_initrddir}/%{name} stop >/dev/null 2>&1
|
||||||
/sbin/chkconfig --del %{name}
|
/sbin/chkconfig --del %{name}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -434,7 +432,27 @@ fi
|
|||||||
%{appdir}/sample
|
%{appdir}/sample
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Aug 26 2008 David Walluck <dwalluck@redhat.com> 0:6.0.18-1.1
|
* Tue Oct 07 2008 David Walluck <dwalluck@redhat.com> 0:6.0.18-6.1
|
||||||
|
- use lsb_release instead of lsb-release to get the distributor
|
||||||
|
|
||||||
|
* Tue Oct 07 2008 David Walluck <dwalluck@redhat.com> 0:6.0.18-5
|
||||||
|
- fix initscript messages on Mandriva Linux
|
||||||
|
- fix help message in initscript
|
||||||
|
|
||||||
|
* Wed Oct 01 2008 David Walluck <dwalluck@redhat.com> 0:6.0.18-4
|
||||||
|
- redefine %%_initrddir for FHS-compliance
|
||||||
|
- make initscript LSB-complaint
|
||||||
|
|
||||||
|
* Fri Sep 26 2008 David Walluck <dwalluck@redhat.com> 0:6.0.18-3
|
||||||
|
- fix status in initscript
|
||||||
|
|
||||||
|
* Thu Sep 25 2008 David Walluck <dwalluck@redhat.com> 0:6.0.18-2
|
||||||
|
- remove initscripts and /sbin/service requirement
|
||||||
|
- call initscript directly without using /sbin/service
|
||||||
|
- require /sbin/chkconfig instead of chkconfig
|
||||||
|
- remove chkconfig requirement from packages that don't require it
|
||||||
|
|
||||||
|
* Tue Aug 26 2008 David Walluck <dwalluck@redhat.com> 0:6.0.18-1
|
||||||
- 6.0.18
|
- 6.0.18
|
||||||
- Resolves: CVE-2008-1232, CVE-2008-1947, CVE-2008-2370, CVE-2008-2938
|
- Resolves: CVE-2008-1232, CVE-2008-1947, CVE-2008-2370, CVE-2008-2938
|
||||||
- fix definition of java.security.policy with d%%{name} start-security
|
- fix definition of java.security.policy with d%%{name} start-security
|
||||||
|
Loading…
Reference in New Issue
Block a user