Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 357729 - sys-apps/openrc: bashism in init scripts
Summary: sys-apps/openrc: bashism in init scripts
Status: RESOLVED DUPLICATE of bug 353124
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-07 10:04 UTC by Michal Hrusecky (RETIRED)
Modified: 2011-03-24 17:21 UTC (History)
1 user (show)

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


Attachments
My /etc/conf.d/net (net,868 bytes, text/plain)
2011-03-08 08:17 UTC, Michal Hrusecky (RETIRED)
Details
Me emerge --info (emerge.info,6.13 KB, text/plain)
2011-03-08 08:18 UTC, Michal Hrusecky (RETIRED)
Details
rcnet.wlan0 --verbose --debug start (net.wlan0,32.65 KB, text/plain)
2011-03-09 10:39 UTC, Michal Hrusecky (RETIRED)
Details
patch for /etc/init.d/cgconfig (cgconfig.patch,3.26 KB, patch)
2011-03-24 17:18 UTC, Christian
Details | Diff
patch for /etc/init.d/cgred (cgred.patch,350 bytes, patch)
2011-03-24 17:18 UTC, Christian
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Hrusecky (RETIRED) gentoo-dev 2011-03-07 10:04:42 UTC
I changed /bin/sh symlink to point to something else then /bin/bash to prevent myself from using bashisms in shell scripts and my network stopped to work. Thanks to this I found out, that some init scripts does no longer work. Most important one of them is net, other one is cgconfig.
So please either fix initscripts not to use bashishms or change interpreter to /bin/bash.

Reproducible: Always

Steps to Reproduce:
1. emerge dash
2. rm /bin/sh
3. ln -s dash /bin/sh
4. /etc/init.d/net.wlan0 restart
Actual Results:  
 * Caching service dependencies ...                                                                                                   [ ok ]
 * Bringing up interface wlan0
[: 1: y: unexpected operator
 *   Creating bridge wlan0 ...
add bridge failed: Package not installed                                                                                              [ !! ]
 * ERROR: net.wlan0 failed to start

Expected Results:  
 * Bringing up interface wlan0
 *   Starting wpa_supplicant on wlan0 ...                                                                                             [ ok ]
 *   Starting wpa_cli on wlan0 ...                                                                                                    [ ok ]
 *   Backgrounding ... ...
 * WARNING: net.wlan0 has started, but is inactive


/bin/sh != /bin/bash !!!
Comment 1 SpanKY gentoo-dev 2011-03-07 22:19:27 UTC
you must post `emerge --info` in all your bug reports like the documentation says to.  further, post your /etc/conf.d/net file as an attachment.
Comment 2 Michal Hrusecky (RETIRED) gentoo-dev 2011-03-08 08:17:01 UTC
Created attachment 265117 [details]
My /etc/conf.d/net
Comment 3 Michal Hrusecky (RETIRED) gentoo-dev 2011-03-08 08:18:07 UTC
Created attachment 265119 [details]
Me emerge --info
Comment 4 Michal Hrusecky (RETIRED) gentoo-dev 2011-03-08 08:20:03 UTC
Providing requested info

Portage 2.1.9.42 (default/linux/amd64/10.0/desktop, gcc-4.5.2, glibc-2.13-r1, 2.6.38-rc7-misibook x86_64)
=================================================================
System uname: Linux-2.6.38-rc7-misibook-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7500_@_2.20GHz-with-gentoo-2.0.1
Timestamp of tree: Mon, 07 Mar 2011 08:00:01 +0000
ccache version 3.1.4 [disabled]
app-shells/bash:     4.2_p7
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1-r1, 3.1.3-r1
dev-util/ccache:     3.1.4
dev-util/cmake:      2.8.4
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.7.0
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       3.4.6-r2, 4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -msse -msse2 -mssse3 -mmmx -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -msse -msse2 -mssse3 -mmmx -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="cs_CZ.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="cs en"
MAKEOPTS="-j3"
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="/home/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/local /usr/local/portage/layman/sunrise /usr/local/portage/layman/lab /usr/local/portage/layman/science /usr/local/portage/layman/mozilla /usr/local/portage/layman/ruby /usr/local/portage/layman/systemd /usr/local/portage/layman/bazaar /usr/local/portage/layman/zugaina"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac aacs aalib abiword acl acpi aften aiglx aio alsa amd64 amr animgif anthy apache2 aplaymidi apm archive asf aspell ass async audio audioscrobbler authfile automap avahi bash-completion bazaar berkdb bittorrent blender-game blink bluetooth bluray branding browser bs2b btrfs bzip2 cairo ccache cddb cdparanoia cdr cdrdao chardet cli client clutter colordiff colors contrast contrib corefonts cover cracklib crypt css csv ctype cue cups curl cvs cxx dbus device-mapper dga djvu dri dri2 dts dv dvb dvd dvdnav dvdr dvdread emboss enca encode esd exif extensions extras fading-colors fam fbcon ffmpeg firefox flac flv ftp fuse gd gdbm geoip gif gimp glib glx gnutls gpg gpgme gpm gps graphviz gstreamer gtk gtk2 gzip h264 hddtemp http hunspell hvm i2c ical iconv imap immqt inotify insecure-patches iproute2 ipv6 irmc ithreads jabber javascript jpeg jpeg2k kqemu latex lcms libcaca libffi libnotify lirc lzma lzo mad matroska mbox mikmod mime mmx mmxext mng modplug modules mp2 mp3 mp4 mpeg mplayer mudflap multilib nas ncurses nls notebook nptl nptlonly nsplugin obex ogg openexr opengl openmp openssl osd pam pango pcre pda pdf perl php php5 plugins png pnm portage postscript ppds pppd private-headers pulseaudio python qt3support qt4 quicktime ramdisk readline recode ruby schroedinger scrobbler sdl serjtag session slang slp sms smtp sndfile sockets sox speex spell sqlite sqlite3 srt sse sse2 ssl ssse3 startup-notification subversion svg syncml sysfs system-sqlite tcpd tga theora threads threadsafe tiff timidity tk truetype type1 udev unicode usb vcd vde vhosts vim-syntax vorbis wavpack webkit wifi wma wpa wxwindows x264 xanim xcb xcomposite xinerama xinetd xml xmp xorg xosd xrandr xscreensaver xslt xv xvid xvmc yv12 zeroconf zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 synaptics mouse joystick evdev dummy" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="cs en" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="arm i386 m68k mipsel ppc ppc64 x86_64" QEMU_USER_TARGETS="arm i386 m68k mipsel ppc ppc64 x86_64" RUBY_TARGETS="ruby18" SANE_BACKENDS="gt68xx" USERLAND="GNU" VIDEO_CARDS="intel i810 fbdev vesa dummy" 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 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-03-08 11:27:32 UTC
Michal:
Can you include the output of
/etc/init.d/net.wlan0 --verbose start

So we can trace down where the bashism is.


P.S.
Good to see you again :-). Still packaging MySQL for SuSE?
Comment 6 Michal Hrusecky (RETIRED) gentoo-dev 2011-03-09 10:39:27 UTC
Created attachment 265275 [details]
rcnet.wlan0 --verbose --debug start
Comment 7 Michal Hrusecky (RETIRED) gentoo-dev 2011-03-09 10:48:15 UTC
--verbose didn't showed anything interesting that could help with fixing this bug. So I added --debug too ;-) I don't think I have any bridging enabled (at least it doesn't show with /bin/sh pointing to /bin/bash), but I guess that trying bridging might be caused by failing test.

PS: Yes, still packaging MySQL for SuSE and like it (mostly), but doing some other stuff too (see bug 357919)
Comment 8 SpanKY gentoo-dev 2011-03-09 21:00:04 UTC

*** This bug has been marked as a duplicate of bug 353124 ***
Comment 9 Christian 2011-03-24 17:17:32 UTC
please reopen, he didn't only ask for net scripts, but for libcgroups scripts, too.
have too patches for the libcgroup scripts, that work for me,  but would be better if someone can recheck them.
Comment 10 Christian 2011-03-24 17:18:23 UTC
Created attachment 267109 [details, diff]
patch for /etc/init.d/cgconfig
Comment 11 Christian 2011-03-24 17:18:50 UTC
Created attachment 267111 [details, diff]
patch for /etc/init.d/cgred
Comment 12 SpanKY gentoo-dev 2011-03-24 17:20:46 UTC
this isnt a dumping ground for random init.d bugs.  the two files you posted have nothing to do with openrc.  find out what package they actually come from and then file a *new* bug.