Bug 200375

Summary: dns/bind910: rcorder loop detected ldconfig -> named -> NETWORKING -> mountcritremote -> ldconfig
Product: Ports & Packages Reporter: c.kworr
Component: Individual Port(s)Assignee: Mathieu Arnold <mat>
Status: Closed FIXED    
Severity: Affects Some People CC: portmgr, ports-bugs
Priority: --- Flags: linimon: maintainer-feedback?
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
This script generates dependency graph of all rc scripts with graphviz (ovals are orphans). none

Description c.kworr 2015-05-21 21:22:33 UTC
Created attachment 157017 [details]
This script generates dependency graph of all rc scripts with graphviz (ovals are orphans).

Hi all. Got riddle for ya.

(I'm running STABLE-10)

Technically during startup 'ldconfig' should be after 'mountcritremote' that requires 'NETWORKING' so that network mounted filesystems would work. With 'named' being part of network connectivity it should start before 'NETWORKING' but if it requires libxml or some other /usr/local library it should start after 'ldconfig'. Hence the loop.

Right now rcorder places 'named' before 'ldconfig' for me thus 'named' startup fails.

I'm directing this to the port maintainer to confirm the problem in case I'm wrong somewhere. I don't know how to fix it. From my point of view rcorder should be fixed instead to value REQUIRE statements higher then BEFORE statements.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2015-05-23 14:17:47 UTC
Assign to maintainer of bind910.  Keep portmgr in the Cc: for evaluation of the graphviz script (which sounds interesting to me).
Comment 2 Mathieu Arnold freebsd_committer freebsd_triage 2015-05-24 09:49:09 UTC
Mmmmm, I think I know why it never failed for me, I build WITH_OPENSSL_PORTS, and it adds :

# readelf -d /usr/local/sbin/named|grep local
 0x000000000000000f (RPATH)              Library rpath: [/usr/local/lib]
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/local/lib]

so it always can find:

# ldd /usr/local/sbin/named|grep local
/usr/local/sbin/named:
        libcrypto.so.8 => /usr/local/lib/libcrypto.so.8 (0x800aa8000)
        libGeoIP.so.1 => /usr/local/lib/libGeoIP.so.1 (0x8010b2000)
        libxml2.so.2 => /usr/local/lib/libxml2.so.2 (0x8012e8000)
        libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x80185a000)

even before ldconfig runs at startup.

I wonder if:

# REQUIRE: NETWORKING ldconfig
# BEFORE: syslogd

would be ok ?
Comment 3 c.kworr 2015-05-25 15:50:39 UTC
Yep, everything starts correctly now. The rcorder part between ldconfig and named for me looks like:

/etc/rc.d/ldconfig
/etc/rc.d/devfs
/etc/rc.d/ipmon
/etc/rc.d/mdconfig2
/etc/rc.d/newsyslog
/etc/rc.d/kdc
/etc/rc.d/watchdogd
/etc/rc.d/savecore
/etc/rc.d/archdep
/etc/rc.d/abi
/etc/rc.d/SERVERS
/usr/local/etc/rc.d/tcsd
/usr/local/etc/rc.d/named

But this mostly due to 'tcsd' (security/trousers) want's to start before 'named' and after 'SERVERS'. I'll go howl at that hole now.

Thanks.
Comment 4 commit-hook freebsd_committer freebsd_triage 2015-06-01 10:14:46 UTC
A commit references this bug:

Author: mat
Date: Mon Jun  1 10:14:00 UTC 2015
New revision: 388211
URL: https://svnweb.freebsd.org/changeset/ports/388211

Log:
  Make BIND start a bit later (and really *after* ldconfig.) [1]
  Add an option to have it start way later.

  PR:		200375 [1]
  Sponsored by:	Absolight

Changes:
  head/dns/bind910/Makefile
  head/dns/bind910/files/named.in
  head/dns/bind910/pkg-help
  head/dns/bind99/Makefile
  head/dns/bind99/files/named.in
  head/dns/bind99/pkg-help