Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 643322

Summary: net-libs/courier-authlib - /etc/init.d/courier-authlib fails on new no-lib-symlink multilib profiles
Product: Gentoo Linux Reporter: Michael Edenfield <kutulu>
Component: Current packagesAssignee: Net-Mail Packages <net-mail>
Status: RESOLVED FIXED    
Severity: normal CC: mgorny, qa
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 506276    
Attachments: 0001-net-libs-courier-authlib-Fix-libexecdir-to-work-with.patch

Description Michael Edenfield 2018-01-03 20:27:40 UTC
After switching to the new 17.1 profiles, and converting to the no-symlink layout, courier-authlib no longer starts.

    basement /etc/init.d # /etc/init.d/courier-authlib start
     * Starting courier-authlib: authdaemond ...
    basement /etc/init.d # ps aux | grep authdaemon
    root     27704  0.0  0.0   8528   920 pts/2    S+   15:33   0:00 grep --colour=auto authdaemon
    basement /etc/init.d # /etc/init.d/courier-authlib stop
     * Stopping courier-authlib: authdaemond ...
     * start-stop-daemon: no matching processes found
    basement /etc/init.d # grep exec /var/log/mail.log
    Jan  3 13:57:01 basement authdaemond: exec: No such file or directory
    Jan  3 13:57:28 basement authdaemond: exec: No such file or directory
    Jan  3 15:33:44 basement authdaemond: exec: No such file or directory

The init script has a hard-coded reference to /usr/lib to locate authdemond:

    setauth() {
            . /etc/courier/authlib/authdaemonrc
            AUTHLIB="/usr/lib/courier/courier-authlib"
            AUTHDAEMOND="authdaemond"


Manually editing this value to "/usr/lib64/courier/courier-authlib" allows the daemon to start.
Comment 1 Michael Edenfield 2018-01-03 21:50:26 UTC
Portage 2.3.19 (python 3.5.4-final-0, default/linux/amd64/17.1/hardened, gcc-7.2.0, glibc-2.26-r3, 4.8.9-hardened-basement-0 x86_64)
=================================================================
System uname: Linux-4.8.9-hardened-basement-0-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4400+-with-gentoo-2.4.1
KiB Mem:     1987340 total,    176520 free
KiB Swap:    2008120 total,   2004572 free
Timestamp of repository gentoo: Mon, 01 Jan 2018 03:00:01 +0000
Head commit of repository gentoo: 0d371529adae7990e77f0eb567d44b33cbd2a831
sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.26.1-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo, 3.6.3-r1::gentoo
dev-util/cmake:           3.10.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.14.1-r1::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            7.2.0::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r3::gentoo
Repositories:

gentoo
    location: /var/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:

Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -fomit-frame-pointer -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=athlon64 -fomit-frame-pointer -O2 -pipe"
DISTDIR="/var/distfiles"
EMERGE_DEFAULT_OPTS=""
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms split-elog strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/var/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 bash-completion bzip2 cracklib crypt cxx hardened iconv ipv6 multilib ncurses nls nptl openmp pam pcre pie readline samba seccomp ssl ssp unicode vim-syntax xattr xtpax zlib" ABI_X86="64" APACHE2_MODULES="alias authn_core authz_core authz_host cgid deflate dir env filter log_config mime rewrite socache_shmcb status unixd userdir" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" L10N="en_US" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby22" SANE_BACKENDS="net" USERLAND="GNU" VIDEO_CARDS="fbdev nv vesa vga" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Michael Edenfield 2018-01-03 21:52:07 UTC
Sorry, forgot, I'm using the latest: courier-authlib-0.68.0-r1 but I think this problem is version-agnostic.  The init script in the files folder in the portage tree has the problem.
Comment 3 Kostas Kavourakis 2018-01-07 16:32:56 UTC
I just stumbled into the same issue, the hardcoded init script causes startup failure. The path is hardcoded as the init script itself is the file "courier-authlib-r1" in the files folder of the ebuild.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-06-17 06:34:29 UTC
The solution would probably be to stop forcing this silly $(get_libdir) for libexecdir.  I'm going to attach a patch trying to achieve this but I'll need someone to test it in a real deployment.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-06-17 06:38:08 UTC
Created attachment 536072 [details, diff]
0001-net-libs-courier-authlib-Fix-libexecdir-to-work-with.patch
Comment 6 Hanno Böck gentoo-dev 2018-12-18 09:26:30 UTC
I'm wondering if these files belong to "lib" at all.
The default seems to be to place them in /usr/libexec/, which from my understanding is more in line with standards [1].

So unless there are any objections I'd just change to use upstream defaults here.

[1] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html
Comment 7 Larry the Git Cow gentoo-dev 2018-12-21 19:29:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3894ca5794aa573ed1943e735637a9e1f287b6b2

commit 3894ca5794aa573ed1943e735637a9e1f287b6b2
Author:     Hanno <hanno@gentoo.org>
AuthorDate: 2018-12-21 19:28:54 +0000
Commit:     Hanno <hanno@gentoo.org>
CommitDate: 2018-12-21 19:28:54 +0000

    net-libs/courier-authlib: Version bump.
    
    Change libexecdir to courier default (avoids problems with
    no-symlink profiles).
    Remove unneeded .la files.
    Change mysql dependency.
    Update to EAPI=7.
    
    Closes: https://bugs.gentoo.org/643322
    Closes: https://bugs.gentoo.org/665986
    Signed-off-by: Hanno Boeck <hanno@gentoo.org>
    Package-Manager: Portage-2.3.52, Repoman-2.3.12

 net-libs/courier-authlib/Manifest                  |   1 +
 .../courier-authlib/courier-authlib-0.69.0.ebuild  | 150 +++++++++++++++++++++
 net-libs/courier-authlib/files/courier-authlib-r2  |  40 ++++++
 3 files changed, 191 insertions(+)