Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 47010 - emerges done from a remote package server do not create users and groups
Summary: emerges done from a remote package server do not create users and groups
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 47158 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-06 16:25 UTC by Darren Spruell
Modified: 2005-10-07 09:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darren Spruell 2004-04-06 16:25:41 UTC
emerging a package created on a remote server and pulled across using  'emerge package_name -gk' and the PORTAGE_BINHOST variable to not seem to add the user and group specified in the ebuild to the system. So far this has happened in 2 packages that we've tried to install -- nagios-plugins and ntp.

Reproducible: Always
Steps to Reproduce:
1. On one server, emerge an ebuild and use -B or -b with the emerge to build a binary tbz2 package.
2. Publish the packages/All directory out via Apache2. Our URI ended up being "http://server.domain.tld/packages/"
3. On another host, set PORTAGE_BINHOST="http://server.domain.tld/packages/"
4. On the same host, run 'emerge package_name -gk' to install the package from the remote server.

Actual Results:  
In the example of the ntp package, running '/etc/init.d/ntpd start' fails with
"chown: `ntp:ntp': invalid user" because the user and group do not yet exist.
With nagios-plugins, I believe the installation/emerge fails because it tries to
chown files to the user:group nagios and they have not been created.

Expected Results:  
The pkg_setup function in the .ebuild file should be honored and the maintenance
tasks carried out so that the users and groups are created properly.

As a workaround, we simply manually create the users and groups on the system
and then proceed.

# emerge info from the build server:
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.25_pre7-gss-r2)
=================================================================
System uname: 2.4.25_pre7-gss-r2 i686 Pentium III (Coppermine)
Gentoo Base System version 1.4.3.13
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.7.7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium3 -fprefetch-loop-arrays -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium3 -fprefetch-loop-arrays -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache fixpackages sandbox"
GENTOO_MIRRORS="http://gentoo.ccccom.com http://cudlug.cudenver.edu/gentoo/
ftp://cudlug.cudenver.edu/pub/mirrors/distributions/gentoo/
rsync://cudlug.cudenver.edu/gentoo ftp://gentoo.ccccom.com
http://mirror.tucdemonic.org/gentoo/"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://ganymede.sento.com/gentoo-portage"
USE="apache2 apm avi berkdb crypt cups curl encode foomaticdb gd gdbm gif gpm
imap imlib java jpeg kerberos ldap libg++ libwww mad mbox mikmod motif mpeg
mysql ncurses nls odbc oggvorbis opengl oss pam pdflib perl png python quicktime
readline samba sasl sdl slang snmp spell ssl svga tcpd tiff truetype x86 xml2
xmms xv zlib"

# emerge info from the target (client) system:
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0,
2.4.22-gentoo-r5)
=================================================================
System uname: 2.4.22-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.4.3.13p1
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /opt/tomcat/conf /usr/X11R6/lib/X11/xkb
/usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache sandbox"
GENTOO_MIRRORS="ftp://gentoo.ccccom.com http://mirror.tucdemonic.org/gentoo/
ftp://gentoo.noved.org/ rsync://cudlug.cudenver.edu/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa apache2 apm arts avi berkdb bonobo crypt cups encode esd foomaticdb
gd gdbm gif gnome gpm gtk gtk2 gtkhtml guile imap imlib java jpeg ldap libg++
libwww mad mikmod motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam
pdflib perl png python quicktime readline sdl slang spell ssl svga tcltk tcpd
tiff truetype x86 xml2 xmms xv zlib"
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2004-04-07 14:06:12 UTC

*** This bug has been marked as a duplicate of 25152 ***
Comment 2 Masatomo Nakano (RETIRED) gentoo-dev 2004-04-09 10:25:05 UTC
This bug is not dup of #25152.

pkg_setup() is called before build phrase but install phrase.
So portage doesn't call pkg_setup in binary install.
If you want to do it in binary install, you should use pkg_preinst().

Portage devs and vapier, what do you think?
Comment 3 Masatomo Nakano (RETIRED) gentoo-dev 2004-04-09 10:27:21 UTC
*** Bug 47158 has been marked as a duplicate of this bug. ***
Comment 4 SpanKY gentoo-dev 2004-04-09 21:26:37 UTC
from the manpage:
pkg_setup
    This function can be used if the package needs specific setup actions or
    checks to be  preformed  before anything else.

if suddenly the way portage handles functions in an ebuild changes, packages are going to break

the old behavior was to run pkg_setup regardless of whether it was binary or source and i believe that it should stay that way

it's not called 'src_setup', it's called 'pkg_setup'
Comment 5 Masatomo Nakano (RETIRED) gentoo-dev 2004-04-10 04:25:57 UTC
I didn't know it was changed.
I'll ask other portage devs and fix it if it's bug.
Comment 6 Nicholas Jones (RETIRED) gentoo-dev 2004-04-10 23:10:20 UTC
I think we've had this discussion in the distant past... And it was
decided that that particular part was for variables only. You cannot
use pkg_setup for adding users (My $0.02 was at least not exclusively).

It needs to be in postinst (too).
Comment 7 Nicholas Jones (RETIRED) gentoo-dev 2004-04-10 23:11:00 UTC
pkg_setup is called once. The ENVIRONMENT is reloaded, btw.
Comment 8 SpanKY gentoo-dev 2004-04-11 19:38:18 UTC
i dont remember any such discussion ... where did it occur ? if it was offlist (gentoo-dev), why wasnt the list notified of such a significant change ?
Comment 9 Jason Stubbs (RETIRED) gentoo-dev 2005-10-07 09:09:09 UTC
This is fixed.