- Updated to 7.0.29
- Add pidfile as tmpfile - Use systemd for running as unprivileged user - Resolves: rhbz 847751 upgrade path was broken - Resolves: rhbz 850343 use new systemd-rpm macros Merge branch 'f17' of ssh://pkgs.fedoraproject.org/tomcat Conflicts: tomcat.spec
This commit is contained in:
commit
18fb32c606
2
sources
2
sources
@ -1 +1 @@
|
|||||||
b84c51041fdd42e3e08747d6c4db6d30 apache-tomcat-7.0.28-src.tar.gz
|
16b9f637e5ca623cf87a2a1514c8978e apache-tomcat-7.0.29-src.tar.gz
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# SERVICE_NAME is a required value only if the service name is
|
# SERVICE_NAME is a required value only if the service name is
|
||||||
# different from 'tomcat'
|
# different from 'tomcat'
|
||||||
#
|
#
|
||||||
NAME="${SERVICE_NAME:-tomcat}"
|
export NAME="${SERVICE_NAME:-tomcat}"
|
||||||
|
|
||||||
#I'll bet this isn't required.
|
#I'll bet this isn't required.
|
||||||
# unset ISBOOT
|
# unset ISBOOT
|
||||||
@ -42,47 +42,25 @@ if [ -r "/etc/sysconfig/${NAME}" ]; then
|
|||||||
. /etc/sysconfig/${NAME}
|
. /etc/sysconfig/${NAME}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function parseOptions() {
|
|
||||||
options=""
|
|
||||||
options="$options $(
|
|
||||||
awk '!/^#/ && !/^$/ { ORS=" "; print "export ", $0, ";" }' \
|
|
||||||
$TOMCAT_CFG
|
|
||||||
)"
|
|
||||||
if [ -r "/etc/sysconfig/${NAME}" ]; then
|
|
||||||
options="$options $(
|
|
||||||
awk '!/^#/ && !/^$/ { ORS=" ";
|
|
||||||
print "export ", $0, ";" }' \
|
|
||||||
/etc/sysconfig/${NAME}
|
|
||||||
)"
|
|
||||||
fi
|
|
||||||
TOMCAT_SCRIPT="$options ${TOMCAT_SCRIPT}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# See how we were called.
|
# See how we were called.
|
||||||
function start() {
|
function start() {
|
||||||
# fix permissions on the log and pid files
|
# fix permissions on the log and pid files
|
||||||
export CATALINA_PID="/var/run/${NAME}.pid"
|
export CATALINA_PID="/var/run/${NAME}.pid"
|
||||||
touch $CATALINA_PID 2>&1
|
|
||||||
if [ "$?" -eq "0" ]; then
|
|
||||||
chown ${TOMCAT_USER}:${TOMCAT_USER} $CATALINA_PID
|
|
||||||
fi
|
|
||||||
|
|
||||||
touch $TOMCAT_LOG 2>&1
|
touch $TOMCAT_LOG 2>&1
|
||||||
if [ "$?" -eq "0" ]; then
|
if [ "$?" -eq "0" ]; then
|
||||||
chown ${TOMCAT_USER}:${TOMCAT_USER} $TOMCAT_LOG
|
chown ${TOMCAT_USER}:${TOMCAT_USER} $TOMCAT_LOG
|
||||||
fi
|
fi
|
||||||
|
|
||||||
parseOptions
|
|
||||||
if [ "$SECURITY_MANAGER" = "true" ]; then
|
if [ "$SECURITY_MANAGER" = "true" ]; then
|
||||||
$SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} start-security" >> $TOMCAT_LOG 2>&1
|
${TOMCAT_SCRIPT} start-security >> $TOMCAT_LOG 2>&1
|
||||||
else
|
else
|
||||||
$SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} start" >> $TOMCAT_LOG 2>&1
|
${TOMCAT_SCRIPT} start #>> $TOMCAT_LOG 2>&1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop() {
|
function stop() {
|
||||||
parseOptions
|
${TOMCAT_SCRIPT} stop >> $TOMCAT_LOG 2>&1
|
||||||
$SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} stop" >> $TOMCAT_LOG 2>&1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# See how we were called.
|
# See how we were called.
|
||||||
|
@ -149,7 +149,7 @@ function start() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ -f "/var/lock/subsys/${NAME}" ]; then
|
if [ -f "/var/lock/subsys/${NAME}" ]; then
|
||||||
if [ -f "/var/run/${NAME}.pid" ]; then
|
if [ -s "/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
|
||||||
if [ -d "/proc/${kpid}" ]; then
|
if [ -d "/proc/${kpid}" ]; then
|
||||||
@ -210,7 +210,7 @@ function stop() {
|
|||||||
fi
|
fi
|
||||||
if [ "$RETVAL" -eq "0" ]; then
|
if [ "$RETVAL" -eq "0" ]; then
|
||||||
count="0"
|
count="0"
|
||||||
if [ -f "/var/run/${NAME}.pid" ]; then
|
if [ -s "/var/run/${NAME}.pid" ]; then
|
||||||
read kpid < /var/run/${NAME}.pid
|
read kpid < /var/run/${NAME}.pid
|
||||||
until [ "$(ps --pid $kpid | grep -c $kpid)" -eq "0" ] || \
|
until [ "$(ps --pid $kpid | grep -c $kpid)" -eq "0" ] || \
|
||||||
[ "$count" -gt "$SHUTDOWN_WAIT" ]; do
|
[ "$count" -gt "$SHUTDOWN_WAIT" ]; do
|
||||||
@ -262,7 +262,7 @@ case "$1" in
|
|||||||
start
|
start
|
||||||
;;
|
;;
|
||||||
condrestart|try-restart)
|
condrestart|try-restart)
|
||||||
if [ -f "/var/run/${NAME}.pid" ]; then
|
if [ -s "/var/run/${NAME}.pid" ]; then
|
||||||
stop
|
stop
|
||||||
start
|
start
|
||||||
fi
|
fi
|
||||||
@ -271,13 +271,13 @@ case "$1" in
|
|||||||
RETVAL="3"
|
RETVAL="3"
|
||||||
;;
|
;;
|
||||||
force-reload)
|
force-reload)
|
||||||
if [ -f "/var/run/${NAME}.pid" ]; then
|
if [ -s "/var/run/${NAME}.pid" ]; then
|
||||||
stop
|
stop
|
||||||
start
|
start
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
if [ -f "/var/run/${NAME}.pid" ]; then
|
if [ -s "/var/run/${NAME}.pid" ]; then
|
||||||
read kpid < /var/run/${NAME}.pid
|
read kpid < /var/run/${NAME}.pid
|
||||||
if [ -d "/proc/${kpid}" ]; then
|
if [ -d "/proc/${kpid}" ]; then
|
||||||
log_success_msg "${NAME} (pid ${kpid}) is running..."
|
log_success_msg "${NAME} (pid ${kpid}) is running..."
|
||||||
|
@ -14,6 +14,9 @@ After=syslog.target network.target
|
|||||||
Type=forking
|
Type=forking
|
||||||
ExecStart=/usr/sbin/tomcat-sysd start
|
ExecStart=/usr/sbin/tomcat-sysd start
|
||||||
ExecStop=/usr/sbin/tomcat-sysd stop
|
ExecStop=/usr/sbin/tomcat-sysd stop
|
||||||
|
User=tomcat
|
||||||
|
Group=tomcat
|
||||||
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -8,16 +8,20 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Get the tomcat config (use this for environment specific settings)
|
# Get the tomcat config (use this for environment specific settings)
|
||||||
#if [ -z "${TOMCAT_CFG}" ]; then
|
if [ -z "${TOMCAT_CFG}" ]; then
|
||||||
# TOMCAT_CFG="/etc/tomcat/tomcat.conf"
|
TOMCAT_CFG="/etc/tomcat/tomcat.conf"
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
#if [ -r "$TOMCAT_CFG" ]; then
|
if [ -r "$TOMCAT_CFG" ]; then
|
||||||
# . $TOMCAT_CFG
|
. $TOMCAT_CFG
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
|
# Get instance specific config file
|
||||||
|
if [ -r "/etc/sysconfig/${NAME}" ]; then
|
||||||
|
. /etc/sysconfig/${NAME}
|
||||||
|
fi
|
||||||
|
|
||||||
set_javacmd
|
set_javacmd
|
||||||
|
|
||||||
# CLASSPATH munging
|
# CLASSPATH munging
|
||||||
if [ -n "$JSSE_HOME" ]; then
|
if [ -n "$JSSE_HOME" ]; then
|
||||||
CLASSPATH="${CLASSPATH}:$(build-classpath jcert jnet jsse 2>/dev/null)"
|
CLASSPATH="${CLASSPATH}:$(build-classpath jcert jnet jsse 2>/dev/null)"
|
||||||
|
38
tomcat.spec
38
tomcat.spec
@ -31,7 +31,7 @@
|
|||||||
%global jspspec 2.2
|
%global jspspec 2.2
|
||||||
%global major_version 7
|
%global major_version 7
|
||||||
%global minor_version 0
|
%global minor_version 0
|
||||||
%global micro_version 28
|
%global micro_version 29
|
||||||
%global packdname apache-tomcat-%{version}-src
|
%global packdname apache-tomcat-%{version}-src
|
||||||
%global servletspec 3.0
|
%global servletspec 3.0
|
||||||
%global elspec 2.2
|
%global elspec 2.2
|
||||||
@ -54,7 +54,7 @@
|
|||||||
Name: tomcat
|
Name: tomcat
|
||||||
Epoch: 0
|
Epoch: 0
|
||||||
Version: %{major_version}.%{minor_version}.%{micro_version}
|
Version: %{major_version}.%{minor_version}.%{micro_version}
|
||||||
Release: 2%{?dist}
|
Release: 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: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
@ -324,6 +324,8 @@ zip -u output/build/bin/tomcat-juli.jar META-INF/MANIFEST.MF
|
|||||||
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{libdir}
|
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{libdir}
|
||||||
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{logdir}
|
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{logdir}
|
||||||
/bin/touch ${RPM_BUILD_ROOT}%{logdir}/catalina.out
|
/bin/touch ${RPM_BUILD_ROOT}%{logdir}/catalina.out
|
||||||
|
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{_localstatedir}/run
|
||||||
|
/bin/touch ${RPM_BUILD_ROOT}%{_localstatedir}/run/%{name}.pid
|
||||||
/bin/echo "%{name}-%{major_version}.%{minor_version}.%{micro_version} RPM installed" >> ${RPM_BUILD_ROOT}%{logdir}/catalina.out
|
/bin/echo "%{name}-%{major_version}.%{minor_version}.%{micro_version} RPM installed" >> ${RPM_BUILD_ROOT}%{logdir}/catalina.out
|
||||||
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{homedir}
|
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{homedir}
|
||||||
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{tempdir}
|
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{tempdir}
|
||||||
@ -472,6 +474,11 @@ done
|
|||||||
# replace temporary copy with link
|
# replace temporary copy with link
|
||||||
%{__ln_s} -f %{bindir}/tomcat-juli.jar ${RPM_BUILD_ROOT}%{libdir}/
|
%{__ln_s} -f %{bindir}/tomcat-juli.jar ${RPM_BUILD_ROOT}%{libdir}/
|
||||||
|
|
||||||
|
mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/tmpfiles.d
|
||||||
|
cat > ${RPM_BUILD_ROOT}%{_prefix}/lib/tmpfiles.d/%{name}.conf <<EOF
|
||||||
|
f %{_localstatedir}/run/%{name}.pid 0644 tomcat tomcat -
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
# add the tomcat user and group
|
# add the tomcat user and group
|
||||||
@ -481,10 +488,7 @@ done
|
|||||||
|
|
||||||
%post
|
%post
|
||||||
# install but don't activate
|
# install but don't activate
|
||||||
if [ $1 -eq 1 ]; then
|
%systemd_post %{name}.service
|
||||||
#initial installation
|
|
||||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
|
||||||
fi
|
|
||||||
|
|
||||||
%post systemv
|
%post systemv
|
||||||
# install but don't activate
|
# install but don't activate
|
||||||
@ -509,19 +513,10 @@ fi
|
|||||||
%preun
|
%preun
|
||||||
# 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
|
%systemd_preun %{name}.service
|
||||||
# package removal, not upgrade
|
|
||||||
/bin/systemctl --no-reload disable tomcat.service > /dev/null 2>&1 || :
|
|
||||||
/bin/systemctl stop tomcat.service > /dev/null 2>&1 || :
|
|
||||||
fi
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
/bin/systemctl daemon-reload > /dev/null 2>&1 || :
|
%systemd_postun_with_restart %{name}.service
|
||||||
if [ $1 -ge 1 ]; then
|
|
||||||
#package upgrade, not uninstall
|
|
||||||
/bin/systemctl try-restart tomcat.service > /dev/null 2>&1 || :
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
%postun jsp-%{jspspec}-api
|
%postun jsp-%{jspspec}-api
|
||||||
if [ "$1" = "0" ]; then
|
if [ "$1" = "0" ]; then
|
||||||
@ -562,6 +557,7 @@ fi
|
|||||||
%defattr(0664,root,tomcat,0770)
|
%defattr(0664,root,tomcat,0770)
|
||||||
%attr(0770,root,tomcat) %dir %{logdir}
|
%attr(0770,root,tomcat) %dir %{logdir}
|
||||||
%attr(0660,tomcat,tomcat) %{logdir}/catalina.out
|
%attr(0660,tomcat,tomcat) %{logdir}/catalina.out
|
||||||
|
%attr(0644,tomcat,tomcat) %{_localstatedir}/run/%{name}.pid
|
||||||
%attr(0770,root,tomcat) %dir %{cachedir}
|
%attr(0770,root,tomcat) %dir %{cachedir}
|
||||||
%attr(0770,root,tomcat) %dir %{tempdir}
|
%attr(0770,root,tomcat) %dir %{tempdir}
|
||||||
%attr(0770,root,tomcat) %dir %{workdir}
|
%attr(0770,root,tomcat) %dir %{workdir}
|
||||||
@ -577,6 +573,7 @@ fi
|
|||||||
%attr(0660,tomcat,tomcat) %config(noreplace) %{confdir}/tomcat-users.xml
|
%attr(0660,tomcat,tomcat) %config(noreplace) %{confdir}/tomcat-users.xml
|
||||||
%attr(0664,tomcat,tomcat) %config(noreplace) %{confdir}/web.xml
|
%attr(0664,tomcat,tomcat) %config(noreplace) %{confdir}/web.xml
|
||||||
%dir %{homedir}
|
%dir %{homedir}
|
||||||
|
%{_prefix}/lib/tmpfiles.d/%{name}.conf
|
||||||
%{bindir}/bootstrap.jar
|
%{bindir}/bootstrap.jar
|
||||||
%{bindir}/catalina-tasks.xml
|
%{bindir}/catalina-tasks.xml
|
||||||
%{homedir}/lib
|
%{homedir}/lib
|
||||||
@ -660,6 +657,13 @@ fi
|
|||||||
%attr(0644,root,root) %{_unitdir}/%{name}-jsvc.service
|
%attr(0644,root,root) %{_unitdir}/%{name}-jsvc.service
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Aug 24 2012 Ivan Afonichev <ivan.afonichev@gmail.com> 0:7.0.29-1
|
||||||
|
- Updated to 7.0.29
|
||||||
|
- Add pidfile as tmpfile
|
||||||
|
- Use systemd for running as unprivileged user
|
||||||
|
- Resolves: rhbz 847751 upgrade path was broken
|
||||||
|
- Resolves: rhbz 850343 use new systemd-rpm macros
|
||||||
|
|
||||||
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:7.0.28-2
|
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:7.0.28-2
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user