Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 49198 - courier 0.45.2 init.d script broken
Summary: courier 0.45.2 init.d script broken
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Scott Taylor (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-27 12:46 UTC by Frank Benkstein
Modified: 2004-04-28 08:56 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 Frank Benkstein 2004-04-27 12:46:18 UTC
I think this explains it:

<code>
h6635 ~ # qpkg -nc -l courier | egrep -e '^/usr/sbin/(courier|pop3d|imap)'
/usr/sbin/courier
/usr/sbin/courieresmtpd -> /usr/lib/courier/courier/modules/esmtp/courieresmtpd 1083079384
/usr/sbin/courierfilter
/usr/sbin/courierlogger
/usr/sbin/couriertcpd
/usr/sbin/imapd -> /usr/share/courier/imapd 1083079385
/usr/sbin/pop3d -> /usr/share/courier/pop3d 1083079385
/usr/sbin/pop3d-ssl -> /usr/share/courier/pop3d-ssl 1083079385
/usr/sbin/imapd-ssl -> /usr/share/courier/imapd-ssl 1083079385
h6635 ~ # egrep -e '((imapd|pop3d)(-ssl)? start)|(sbindir=)' /etc/init.d/courier 
sbindir="/usr/sbin"
                ${sbindir}/courier-pop3d start
                ${sbindir}/courier-pop3d-ssl start
                ${sbindir}/courier-imapd start
                ${sbindir}/courier-imapd-ssl start
</code>

Either the init script should be changed or the links should be named /usr/sbin/courier-* which I would prefer.
Comment 1 Scott Taylor (RETIRED) gentoo-dev 2004-04-27 16:49:09 UTC
The init script has been calling ${sbindir}/courier-pop3d start (and the others
named like it) for some 9 months now. I rolled back to 0.45.2 on my own system
and it still makes the proper symlinks, as does 0.45.4 (~x86). What architecture
and USE flags are you using?



Blue All # emerge -pv courier ; qpkg -nc -l courier | egrep -e '^/usr/sbin/(courier|pop3d|imap)'
 
These are the packages that I would merge, in order:
 
Calculating dependencies ...done!
[ebuild     U ] net-mail/courier-0.45.4 [0.45.2] +crypt -fax +ipv6 -ldap +mysql -nls +norewrite +pam -postgres +spell  0 kB
 
Total size of downloads: 0 kB
 
/usr/sbin/courier-imapd -> /usr/share/courier/imapd 1083109335
/usr/sbin/courier-pop3d -> /usr/share/courier/pop3d 1083109335
/usr/sbin/courier
/usr/sbin/courier-imapd-ssl -> /usr/share/courier/imapd-ssl 1083109335
/usr/sbin/courieresmtpd -> /usr/lib/courier/courier/modules/esmtp/courieresmtpd 1083109335
/usr/sbin/courierfilter
/usr/sbin/courierlogger
/usr/sbin/courier-pop3d-ssl -> /usr/share/courier/pop3d-ssl 1083109335
/usr/sbin/couriertcpd

Blue All # emerge -p courier ; qpkg -nc -l courier | egrep -e '^/usr/sbin/(courier|pop3d|imap)'
 
These are the packages that I would merge, in order:
 
Calculating dependencies ...done!
[ebuild   R   ] net-mail/courier-0.45.4
 
/usr/sbin/courier-imapd -> /usr/share/courier/imapd 1082584018
/usr/sbin/courier-pop3d -> /usr/share/courier/pop3d 1082584018
/usr/sbin/courier
/usr/sbin/courier-imapd-ssl -> /usr/share/courier/imapd-ssl 1082584018
/usr/sbin/courieresmtpd -> /usr/lib/courier/courier/modules/esmtp/courieresmtpd 1082584018
/usr/sbin/courierfilter
/usr/sbin/courierlogger
/usr/sbin/courier-pop3d-ssl -> /usr/share/courier/pop3d-ssl 1082584018
/usr/sbin/couriertcpd
Comment 2 Frank Benkstein 2004-04-27 22:52:25 UTC
First system:
Portage 2.0.50-r6 (default-x86-2004.0, gcc-3.3.2, glibc-2.3.2-r9, 2.4.25)
=================================================================
System uname: 2.4.25 i686 Intel(R) Celeron(R) CPU 2.40GHz
Gentoo Base System version 1.4.9
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=i686 -O2 -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/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache sandbox"
GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages/i686"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.de.entoo.org/gentoo-portage"
USE="aalib acpi acpi4linux apache2 apm arts avi berkdb cgi crypt cups devfs djbfft dnsdb foomaticdb gdbm gif gtk gtk2 imlib jpeg kde libg++ libwww mad maildir mbox md5sum mikmod mmx mpeg ncurses nls oav odbc offensive oggvorbis oss pam pdflib perl pic png postgres python readline regexp roundrobin serial slang snmp spell sqlite sse ssl svg svga tcpd threads tiff truetype x86 xml xml2 zlib"

Second system:
Portage 2.0.50-r6 (default-x86-2004.0, gcc-3.3.2, glibc-2.3.2-r9, 2.6.5-mm1)
=================================================================
System uname: 2.6.5-mm1 i686 VIA C3 Ezra
Gentoo Base System version 1.4.9
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=i586 -Os -pipe"
CHOST="i586-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.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="-march=i586 -Os -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache sandbox"
GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="3dnow X Xaw3d aalib acl acpi acpi4linux alsa apache2 apm avi berkdb cle266 crypt cups devfs dga dillo directfb dvd encode esd fam fbcon fbdev foomaticdb freetype fs gd gdbm ggi gif gimpprint gtk gtk2 ieee1394 imap imlib ipv6 jack java javascript jikes jpeg jython lesstif libg++ libwww mad mbox mikmod mmx motif mpeg mpeg4 mysql nas ncurses nls oav offensive oggvorbis openal opengl oss pam pdflib perl php pic png postgres ppds python quicktime readline samba sdl slang speedo speex spell ssl svga tcltk tcpd theora truetype type1 unicode usb v4l v4l2 vhosts x86 xface xfs xine xml2 xmms xv xvid zlib"
Comment 3 Scott Taylor (RETIRED) gentoo-dev 2004-04-27 23:46:25 UTC
This piece of code in the ebuild should be taking care of renaming the files to
what you were expecting. Perhaps if you try emerge -d courier, or even just
adding a "set -v -x" right after the pkg_preinst() line in the ebuild to see
whats happening right there. 

When I build this as a binary on my system, it seems to build the .tbz2 before
doing the renaming, and i do see the buildpkg feature set on your systems.
Could you maybe take out the FEATURE="buildpkg" and try emerging this again?


pkg_preinst() {

    cd ${D}/usr/sbin
    for y in imapd imapd-ssl pop3d pop3d-ssl
    do
        mv ${y} courier-${y}
    done
                                                                                                                                                                     
Comment 4 Frank Benkstein 2004-04-27 23:55:28 UTC
I made the same discovery just before reading your post:

<code>
h6635 ~ # ebuild /usr/portage/net-mail/courier/courier-0.45.2.ebuild install
[...]
>>> Completed installing into /var/tmp/portage/courier-0.45.2/image/
h6635 /var/tmp/portage/courier-0.45.2/image # cd /var/tmp/portage/courier-0.45.2/image/usr/sbin/
h6635 /var/tmp/portage/courier-0.45.2/image/usr/sbin # ls -o courier* imap* pop*
-r-xr-xr-x    1 mail        15152 Apr 28 08:04 courier
lrwxrwxrwx    1 root           52 Apr 28 08:04 courieresmtpd -> /usr/lib/courier/courier/modules/esmtp/courieresmtpd
-r-x------    1 root        14912 Apr 28 08:04 courierfilter
-r-xr-xr-x    1 mail         4128 Apr 28 08:04 courierlogger
-r-xr-xr-x    1 mail        54464 Apr 28 08:04 couriertcpd
lrwxrwxrwx    1 root           24 Apr 28 08:04 imapd -> /usr/share/courier/imapd
lrwxrwxrwx    1 root           28 Apr 28 08:04 imapd-ssl -> /usr/share/courier/imapd-ssl
lrwxrwxrwx    1 root           24 Apr 28 08:04 pop3d -> /usr/share/courier/pop3d
lrwxrwxrwx    1 root           28 Apr 28 08:04 pop3d-ssl -> /usr/share/courier/pop3d-ssl
</code>

<code>
pkg_preinst() {
[...]
        cd ${D}/usr/sbin
        for y in imapd imapd-ssl pop3d pop3d-ssl
        do
                mv ${y} courier-${y}
        done
[...]
}
</code>

Is this in the right place? Shouldn't this be at the end of src_install?
Comment 5 Scott Taylor (RETIRED) gentoo-dev 2004-04-28 00:09:20 UTC
Do you install things with "emerge courier" or do you normally try to single-step
through the ebuild process? The emerge command *should* be calling the pkg_preinst
for you each time, before calling the install routine.
Comment 6 Scott Taylor (RETIRED) gentoo-dev 2004-04-28 01:36:18 UTC
moved file renaming to the src_compile function. checked into cvs. 
Comment 7 Frank Benkstein 2004-04-28 08:56:29 UTC
> Do you install things with "emerge courier" or do you normally try to
> single-step through the ebuild process?

No I normally use emerge.
(But single stepping through the process is equivalent to emerge, isn't it?)

> The emerge command *should* be calling the pkg_preinst
> for you each time, before calling the install routine.

Yes and I think this is the problem here. Could it be that pkg_preinst tries to move the files before they are there?

> moved file renaming to the src_compile function. checked into cvs.

I test as soon as possible and then report back.