SUMMARY: groupdel error during pkgrm

From: Michael Hill (Michael2.Hill@level3.com)
Date: Fri Dec 17 1999 - 10:27:15 CST


My original question:

On Thu, Dec 16, 1999 at 05:15:51PM -0700, Michael Hill wrote:
>Hey, fellow Sun SAs,
>
>I've been reading for a couple of years, and now I finally have a
>question to ask. I searched the FAQ as well as my own cache of
>summaries, but didn't find any occurrence of 'groupdel'.
>
>I've built a package that adds a user required for file ownership
>(during preinstall). The problem is while removing the package, during
>postremove, I issue a 'userdel' followed (or preceded; order doesn't
>matter) by a 'groupdel'. The groupdel *always* fails with the following
>error message:
>
>UX: groupdel: ERROR: Cannot update system files - group cannot be deleted.
>
>However, running the same command from the command line works with no
>problems and with a return code of 0. (And I always have to run it
>after removing the package, because it fails during pkgrm.) Also, the
>accompanying 'userdel' never fails.
>
>Any ideas why this seems to happen only during pkgrm? TIA && IWS.

Thanks to the following people:
        Kevin Sheehan {Consulting Poster Child}
        Carsten B. Knudsen
        Sullivan, Rich
... and anyone else who may yet reply.

Kevin Sheehan {Consulting Poster Child} wrote:
>> Any ideas why this seems to happen only during pkgrm? TIA && IWS.
>
>Not of the top of my head, but a truss -o /tmp/foo -f pkgrm ... might
>be instructive as to what groupdel has a problem with...

I did try to truss it (before posting), but didn't see anything obvious.
Just the expected open()s on /etc/passwd and /etc/group.

Sullivan, Rich wrote:
>Putting the package aside. DId u try to simply automate those two first
>procedures? Thats is use a simple for loop and remove the user and hten the
>group? Do you get the same answer?
>I have seen issues where home grown packages have behaved funky.
>Try,
>for i in 1
>do
>deletions
>done
>Let me know if the same thing happens.

I had tried putting the commands in a script and executing it, and it
worked fine, just as you would expect. It was something related to
pkgrm....

Carsten B. Knudsen gets the gold star. He wrote:
>Yep, we have had exactly that problem. The problem is as follows:
>
>1) groupdel creates a temporary file that is eventually renamed to "group"
>
>BUT:
>
>2) "pkgrm" sets $TMPDIR to "/var/tmp", causing the tempfile to be created
>here, so the rename() at the end fails whenever /var/tmp lives in a
>different filesystem - which it, IMHO, always should.
>
>So, basically, it's a bug in groupdel that Sun just never caught because
>they have this s@@@@ idea of putting /var on the root fs.
>
>The cure/fix/workaround is to make sure $TMPDIR in unset just before
>calling groupdel.

Just inserting "TMPDIR= " before the groupdel command did it. Thanks a
lot, Carsten!

<SOAPBOX>
I received three "useful" replies (so far), and about eight replies from
autoresponders/vacation programs. Folks, please use some intelligence
with mailing lists (like using procmail before sending an automated
reply).
</SOAPBOX>

-- 
			--Michael

------------------------------------------------------------------------------- Michael Hill <>< Isaiah 9:6 | "It is the soldier, not the reporter, Michael2.Hill@level3.com | Who has given us freedom of the press. Aerospace/Software Engineer | It is the soldier, not the poet, Level (3) Communications | Who has given us freedom of speech." http://www.qadas.com/~msh/ | --Charles M. Province ---In a marketplace (like the one of ideas), not everything has equal value!--- Did you ever notice that everybody in favor of abortion has already been born?!



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:35 CDT