[JPackage-discuss] upgrading from tomcat5-5.0.X to tomcat5-5.5.X does not work

Reginald Poyau rpoyau at gmail.com
Fri May 11 21:42:16 CEST 2007


Upgrading from tomcat5-5.0.X to tomcat5-5.5.X is broken because
tomcat5-5.5.X uses tomcat for user and group with userid and groupid
91

tomcat5-5.0.30-11jpp spec file
This is specified in the tomcat5.spec file here
%define tcuid		91

%pre
# Add the "tomcat" user and group
# we need a shell to be able to use su - later
%{_sbindir}/groupadd -g %{tcuid} -r tomcat4 2> /dev/null || :
%{_sbindir}/useradd -c "Tomcat4" -u %{tcuid} -g tomcat4 \
    -s /bin/sh -r -d %{homedir} tomcat4 2> /dev/null || :


------------------------

tomcat5-5.5.23-8jpp spec file:
%define tcuid		91

%pre
# Add the "tomcat" user and group
# we need a shell to be able to use su - later
%{_sbindir}/groupadd -g %{tcuid} -r tomcat 2> /dev/null || :
%{_sbindir}/useradd -c "Apache Tomcat" -u %{tcuid} -g tomcat \
    -s /bin/sh -r -d %{homedir} tomcat 2> /dev/null || :

Now notice that both are using the same id 91.  The %pre in
tomcat5-5.5.23 fails because one cannot create user and group tomcat
with 91 because that id is already being used by tomcat4.

The %pre in tomcat-5.5.23 should delete user tomcat4 first
Fix for  %pre
%pre
# Add the "tomcat" user and group
# we need a shell to be able to use su - later
# remove old tomcat4 user/group if necessary first.
/usr/bin/id tomcat4 >/dev/null 2>&1 && %{_sbindir}/userdel tomcat4
%{_sbindir}/groupadd -g %{tcuid} -r tomcat 2> /dev/null || :
%{_sbindir}/useradd -c "Apache Tomcat" -u %{tcuid} -g tomcat \
    -s /bin/sh -r -d %{homedir} tomcat 2> /dev/null || :



More information about the JPackage-discuss mailing list