I've noticed that in some situations, packages that add users/groups in %pre/post can fail. What I most often see happening is while groupadd or useradd is installed, and properly requested by Requires(pre) or Requires(post) on shadow-utils, the /etc/group and /etc/passwd files themselves aren't in place. These come from the setup package.
Should the shadow-utils package Require the setup package, or require it in such a way that it is in place before anything that calls shadow-utils? Should the packages that need to add users/groups not only Requires(foo) on shadow-utils, but also setup?
Thoughts?
Once upon a time, Jesse Keating jkeating@redhat.com said:
I've noticed that in some situations, packages that add users/groups in %pre/post can fail. What I most often see happening is while groupadd or useradd is installed, and properly requested by Requires(pre) or Requires(post) on shadow-utils, the /etc/group and /etc/passwd files themselves aren't in place. These come from the setup package.
Should the shadow-utils package Require the setup package, or require it in such a way that it is in place before anything that calls shadow-utils? Should the packages that need to add users/groups not only Requires(foo) on shadow-utils, but also setup?
I'd say that if useradd and groupadd can't work without /etc/passwd and /etc/group, then shadow-utils should require /etc/passwd and /etc/group (wouldn't a file Requires make more sense than a static package Requires?). It doesn't make sense to change a bunch of packages to require setup, since that could always change (and what a PITA that would be).
On Sun, 2008-12-21 at 10:03 -0600, Chris Adams wrote:
Once upon a time, Jesse Keating jkeating@redhat.com said:
I've noticed that in some situations, packages that add users/groups in %pre/post can fail. What I most often see happening is while groupadd or useradd is installed, and properly requested by Requires(pre) or Requires(post) on shadow-utils, the /etc/group and /etc/passwd files themselves aren't in place. These come from the setup package.
Should the shadow-utils package Require the setup package, or require it in such a way that it is in place before anything that calls shadow-utils? Should the packages that need to add users/groups not only Requires(foo) on shadow-utils, but also setup?
I'd say that if useradd and groupadd can't work without /etc/passwd and /etc/group, then shadow-utils should require /etc/passwd and /etc/group (wouldn't a file Requires make more sense than a static package Requires?). It doesn't make sense to change a bunch of packages to require setup, since that could always change (and what a PITA that would be).
FWIW for the short term I've added 'setup' as a Requires in shadow-utils. This fixes the rpm ordering issue I was seeing. The maintainer for shadow-utils can choose to adjust that to a series of file requirements if they feel that's better.
Jesse Keating (jkeating@redhat.com) said:
I've noticed that in some situations, packages that add users/groups in %pre/post can fail. What I most often see happening is while groupadd or useradd is installed, and properly requested by Requires(pre) or Requires(post) on shadow-utils, the /etc/group and /etc/passwd files themselves aren't in place. These come from the setup package.
Should the shadow-utils package Require the setup package, or require it in such a way that it is in place before anything that calls shadow-utils? Should the packages that need to add users/groups not only Requires(foo) on shadow-utils, but also setup?
Thoughts?
How on earth do you get things installed w/o setup first? glibc -> basesystem -> setup.
Bill
On Mon, 2008-12-22 at 10:42 -0500, Bill Nottingham wrote:
How on earth do you get things installed w/o setup first? glibc -> basesystem -> setup.
*shrug* it's just anaconda doing it's package install to build the install image. Given that shadow-utils doesn't mention setup at all, rpm can't possibly know that setup should come before shadow-utils. I worked this down to a simple reproducer, just creating a fresh chroot and asking yum to install NetworkManager will trigger the ordering issue (at least on i386). Giving rpm the hint that shadow-utils needs setup fixes the ordering issue.
Jesse Keating (jkeating@redhat.com) said:
How on earth do you get things installed w/o setup first? glibc -> basesystem -> setup.
*shrug* it's just anaconda doing it's package install to build the install image. Given that shadow-utils doesn't mention setup at all, rpm can't possibly know that setup should come before shadow-utils.
Sure it does.
Package A has a Requires(pre) on shadow-utils. Hence, shadow-utils must be installed *and functional* before A is installed. This means shadow-utils and all its requirements.
From there it's a simple dependency chain - shadow-utils -> glibc
-> basesystem -> setup.
So, if it's not getting installed right, rpm or yum is broken in some way.
Bill
On Mon, 22 Dec 2008, Bill Nottingham wrote:
Jesse Keating (jkeating@redhat.com) said:
How on earth do you get things installed w/o setup first? glibc -> basesystem -> setup.
*shrug* it's just anaconda doing it's package install to build the install image. Given that shadow-utils doesn't mention setup at all, rpm can't possibly know that setup should come before shadow-utils.
Sure it does.
Package A has a Requires(pre) on shadow-utils. Hence, shadow-utils must be installed *and functional* before A is installed. This means shadow-utils and all its requirements.
From there it's a simple dependency chain - shadow-utils -> glibc
-> basesystem -> setup.
So, if it's not getting installed right, rpm or yum is broken in some way.
...or there's some funny new dependency loop somewhere, breaking the ordering.
- Panu -
On Mon, 22 Dec 2008, Panu Matilainen wrote:
On Mon, 22 Dec 2008, Bill Nottingham wrote:
Jesse Keating (jkeating@redhat.com) said:
How on earth do you get things installed w/o setup first? glibc -> basesystem -> setup.
*shrug* it's just anaconda doing it's package install to build the install image. Given that shadow-utils doesn't mention setup at all, rpm can't possibly know that setup should come before shadow-utils.
Sure it does.
Package A has a Requires(pre) on shadow-utils. Hence, shadow-utils must be installed *and functional* before A is installed. This means shadow-utils and all its requirements.
From there it's a simple dependency chain - shadow-utils -> glibc
-> basesystem -> setup.
So, if it's not getting installed right, rpm or yum is broken in some way.
...or there's some funny new dependency loop somewhere, breaking the ordering.
And yes there are nasty loops: http://laiskiainen.org/tmp/fedora-rawhide-231208-loops.txt For a reproducer try: yum --disablerepo="*" --enablerepo=rawhide --installroot=<somewhere> install sed"
This is so not going to work: [pmatilai@localhost badorder]$ rpm -qp --scripts setup-2.7.5-3.fc11.noarch.rpm postinstall scriptlet (using /bin/sh): if [ `grep -c video /etc/group` -eq 0 ] ; then groupadd -g 39 video fi if [ `grep -c audio /etc/group` -eq 0 ] ; then groupadd -g 63 audio fi
[pmatilai@localhost badorder]$ rpm -qp --requires setup-2.7.5-3.fc11.noarch.rpm |grep -v rpmlib /bin/sh config(setup) = 2.7.5-3.fc11 grep
- Panu -
Panu Matilainen (pmatilai@laiskiainen.org) said:
And yes there are nasty loops: http://laiskiainen.org/tmp/fedora-rawhide-231208-loops.txt For a reproducer try: yum --disablerepo="*" --enablerepo=rawhide --installroot=<somewhere> install sed"
This is so not going to work: [pmatilai@localhost badorder]$ rpm -qp --scripts setup-2.7.5-3.fc11.noarch.rpm postinstall scriptlet (using /bin/sh): if [ `grep -c video /etc/group` -eq 0 ] ; then groupadd -g 39 video fi if [ `grep -c audio /etc/group` -eq 0 ] ; then groupadd -g 63 audio fi
[pmatilai@localhost badorder]$ rpm -qp --requires setup-2.7.5-3.fc11.noarch.rpm |grep -v rpmlib /bin/sh config(setup) = 2.7.5-3.fc11 grep
Bug 477769 filed.
Bill