When tomcat-4.1.14-r1 is getting unmerged after updating tomcat to tomcat-5.0.18 the build fails complaining about trying to remove user tomcat. Also starting /etc/init.d/tomcat fails with this error root@earth # /etc/init.d/tomcat start * Starting Tomcat... Unable to cd to "/home/tomcat" [ !! ] Reproducible: Always Steps to Reproduce: 1.emerge -uD tomcat 2. 3. Actual Results: --- !empty dir /opt/tomcat --- !empty dir /opt --- !empty dir /etc --- !targe sym /opt/tomcat/logs --- !targe sym /opt/tomcat/common/package.env --- !targe sym /opt/tomcat/common/lib --- !targe sym /opt/tomcat/common/endorsed * >>> Removing user for Tomcat !!! ERROR: net-www/tomcat-4.1.24-r1 failed. !!! Function pkg_postrm, Line 138, Exitcode 1 !!! Error removing Tomcat user !!! FAILED postrm: 1 Expected Results: expected tomcat to be successfully updated to tomcat-5.0.18
I've just experienced this. Also, it complains even when trying to emerge unmerge all the tomcat mess. I've removed the tomcat user and group, put them back (id 265 in my case) and still it's stuck. Deleted the contents of whatever I was doing in tomcat (restricted to the webdav app in my case) and still no go. -- Ian Tindale
I kind of fixed that by doing emerge tomcat (installs 5.0.18, fails at 4.1.24-t1 unmerge) vim /var/db/pkg/net-www/tomcat-4.1.24-r1/tomcat-4.1.24-r1.ebuild ( comment out or delete pkg_postrm() ) emerge -P tomcat actually I got these: --- !targe sym /opt/tomcat/common/endorsed shell-init: could not get current directory: getcwd: cannot access parent direc tories: No such file or directory shell-init: could not get current directory: getcwd: cannot access parent direc tories: No such file or directory * Caching service dependencies... chdir: could not get current directory: getcwd: cannot access parent directorie s: No such file or directory [ ok ] BUT I assume these are because I was in /var/db/pkg/net-www/tomcat-4.1.24-r1/ while pruning and have nothing to do with this really. Not sure though, and I can't reproduce it now that my 4.1.24 install is gone ;)
I wish I could reproduce this one, but I can't since the old ebuild fails anyway since tomcat is moved. What happens when you do a emerge -C tomcat emerge tomcat It seems the pruning of the users is what is doing it. I'm going to set it up so you have to uninstall the previous version of tomcat in order to install the new one first unless there's objections and people require more than one tomcat.
emerge -C tomcat also fails with the same message. I made sure there was a valid tomcat entry in passwd, shadow, and group. Then ran an emerge -C and got the following: --- !targe sym /opt/tomcat/common/endorsed * >>> Removing user for Tomcat !!! ERROR: net-www/tomcat-4.1.24-r1 failed. !!! Function pkg_postrm, Line 138, Exitcode 1 !!! Error removing Tomcat user !!! FAILED postrm: 1 The funny thing is that tomcat is successfully removed from passwd and shadow (but not from group as expected). Nothing is actually removed from /opt/tomcat. When doing an emerge -C with NO tomcat entries in passwd, shadow, or group I get the following: * >>> Removing user for Tomcat userdel: user tomcat does not exist !!! ERROR: net-www/tomcat-4.1.24-r1 failed. !!! Function pkg_postrm, Line 138, Exitcode 6 !!! Error removing Tomcat user !!! FAILED postrm: 1 Again, the /opt/tomcat dir remains intact.
strange thing is after then unmerge and the error !!! ERROR: net-www/tomcat-4.1.24-r1 failed. !!! Function pkg_postrm, Line 138, Exitcode 1 !!! Error removing Tomcat user !!! FAILED postrm: 1 root@earth hobo # id tomcat id: tomcat: No such user root@earth hobo # though the group remains root@earth hobo # useradd tomcat useradd: group tomcat exists - if you want to add this user to that group, use -g. root@earth hobo # useradd tomcat -g tomcat root@earth hobo # id tomcat uid=1004(tomcat) gid=265(tomcat) groups=265(tomcat) trying an emerge tomcat or an emerge unmerge or emerge -C tomcat still fails with the same error
tomcat is now stuck in the "emerge clean" queue. Autoclean attempts (unsuccessfully) to unmerge tomcat after every "emerge -u foo". Any way to force an unmerge?
I had some permission problems before changed following line in ebuild "chown -R tomcat.tomcat ${S}" to "chown -R tomcat:tomcat ${S}" Now ebuild 5.0.18 seems to be working in my G3 ibook...
I made the chown edit and successfully installed 5.0.18 but the autoclean still fails. The install (i.e. update) adds the tomcat user but the autoclean removes it again. The /opt/tomcat tree defaults to owner 265 (the default uid from the install). # ll /opt/tomcat total 6 drwxr-x--- 9 265 tomcat 240 Feb 17 23:33 . drwxr-xr-x 15 root root 456 Feb 8 15:16 .. drwxr-xr-x 2 265 tomcat 680 Feb 17 23:33 bin drwxr-xr-x 3 265 tomcat 128 Feb 17 23:33 common drwxr-xr-x 2 265 tomcat 288 Nov 28 18:19 conf lrwxrwxrwx 1 root root 15 Feb 17 23:33 logs -> /var/log/tomcat drwxr-xr-x 4 265 tomcat 96 Feb 17 23:33 server drwxr-xr-x 2 265 tomcat 72 Feb 17 23:33 temp drwxr-xr-x 7 265 tomcat 200 Feb 17 23:33 webapps drwxr-xr-x 3 265 tomcat 104 Feb 17 23:33 work
I fixed mine in an ugly manner. Steps: 1. Edit /var/db/pkg/net-www/tomcat-4.1.24-r1 and comment out the pkg_postrm() function 2. userdel tomcat && groupdel tomcat 3. emerge clean
As the tomcat ebuild uses a variable INSTALLING to check if it should remove the user and group, I was able to cleanly unmerge by doing a INSTALLING=yes emerge -C tomcat Afterwards you can of course manually delete user and group tomcat.
Bear with me guys, I'm re-doing the tomcat ebuilds this weekend. You will have problems with the old ebuilds, I'm sorry for this. You can follow Stefan's advice for now to remove the old versions of tomcat and update them with the new. I'm shooting for sometime this weekend to have r1's for the tomcat ebuilds, including building them from source. Sorry for the delay.
Issue is resolved in the newer tomcats.