Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 366431 - net-dns/bind: named.init-r{9,10} script contains bashism (OpenRC/Baselayout2)
Summary: net-dns/bind: named.init-r{9,10} script contains bashism (OpenRC/Baselayout2)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: BIND Maintainers (DISABLED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-08 08:00 UTC by Andre Ryan
Modified: 2011-06-16 19:35 UTC (History)
1 user (show)

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 Andre Ryan 2011-05-08 08:00:06 UTC
/etc/init.d/named is not compatible with non-bash POSIX shells. It causes app-shells/dash to bail out with a "bad substitution" error when trying to start the script.

Offending code is in the "checkconfig" function:
 /usr/sbin/named-checkconf ${CHROOT:+-t} ${CHROOT} ${NAMED_CONF/${CHROOT}} || {

There's probably a better way to fix it but I just changed it to:
 local conf_script="${NAMED_CONF}"
 if [ -n "${CHROOT}" ]; then
    conf_script="$(echo "${NAMED_CONF}" | sed -e "s#${CHROOT}##g")"
 fi
 /usr/sbin/named-checkconf ${CHROOT:+-t} ${CHROOT} ${conf_script} || {


Reproducible: Always

Steps to Reproduce:
1. emerge bind
2. emerge dash
3. emerge >=baselayout-2 openrc
4. rm /bin/sh && ln -s dash /bin/sh
5. /etc/init.d/named start



Portage 2.1.9.42 (default/linux/x86/10.0, gcc-4.4.5, libc-0-r0, 2.6.37-gentoo-r4 i686)
=================================================================
System uname: Linux-2.6.37-gentoo-r4-i686-AMD_Duron-tm-_Processor-with-gentoo-2.0.2
Timestamp of tree: Sat, 07 May 2011 09:15:01 +0000
app-shells/bash:     4.1_p9
dev-lang/python:     2.7.1-r1, 3.1.3-r1
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.8.2-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1-r1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
sys-kernel/linux-headers: 2.6.36.1
sys-libs/glibc:      2.11.3
virtual/os-headers:  0
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=athlon-tbird -pipe -funswitch-loops -ftree-loop-im -fgcse-after-reload -fpredictive-commoning"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /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="-Os -march=athlon-tbird -pipe -funswitch-loops -ftree-loop-im -fgcse-after-reload -fpredictive-commoning"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://ftp.swin.edu.au/gentoo ftp://ftp.swin.edu.au/gentoo ftp://mirror.datapipe.net/gentoo http://gentoo.mirrors.tds.net/gentoo ftp://gentoo.mirrors.tds.net/gentoo http://gentoo.mirrors.easynews.com/linux/gentoo/ http://gentoo.mirrors.hoobly.com/ ftp://gentoo.mirror.web4u.cz/"
LANG="en_AU.UTF-8"
LDFLAGS="-Wl,--hash-style=gnu,-O1,--sort-common"
LINGUAS="en_GB en"
MAKEOPTS=""
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.au.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext acl bash-completion berkdb bzip2 caps cli cracklib crypt cxx dri fam fbcon fortran gdbm gpm iconv idn ipv6 logrotate mmx mmxext modules mudflap ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline samba session ssl symlink sysfs tcpd underscores unicode usb utempter vim vim-syntax x86 xattr xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv vesa" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Christian Ruppert (idl0r) gentoo-dev 2011-06-16 19:35:35 UTC
This should be fixed in bind-9.8.0_p2-r1. It will be on the mirrors soon. Thanks for your bug report!

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-dns/bind/files/named.init-r11?r1=1.1&r2=1.2