Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 284221 - /lib/udev/move_tmp_persistent_rules.sh from sys-fs/udev needs /bin/bash, not /bin/sh
Summary: /lib/udev/move_tmp_persistent_rules.sh from sys-fs/udev needs /bin/bash, not ...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-08 22:30 UTC by Raffaello D. Di Napoli
Modified: 2009-09-10 05:19 UTC (History)
0 users

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


Attachments
Changes #!/bin/sh to #!/bin/bash (udev-move_tmp_persistent_rules.sh-explicit-bash-dependency.patch,314 bytes, patch)
2009-09-08 22:36 UTC, Raffaello D. Di Napoli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raffaello D. Di Napoli 2009-09-08 22:30:46 UTC
I installed app-shells/dash as a replacement for bash in scripts (mostly for memory footprint); as a part of the process, I also replaced the /bin/sh symlink to one pointing to /bin/dash.

I assumed most of Gentoo has been checked for undeclared dependencies on bash; while I was right, I did find two scripts which use bash but declare /bin/sh instead.
One I already filed a bug for, the other I found out to be /lib/udev/move_tmp_persistent_rules.sh, installed by sys-fs/udev.

I believe this dependency should be made explicit.

Reproducible: Always

Steps to Reproduce:
1. emerge app-shells/dash
2. ln -fs dash /bin/sh
3. reboot
Actual Results:  
(other init messages)
/etc/init.d/functions.sh: 7: source: not found
/etc/init.d/functions.sh: 10: declare: not found
...
(more errors from sourcing functions.sh into a non-bash script)

Expected Results:  
udev-postmount is run, without error messages (it normally displays no output).

emerge --info
Portage 2.1.6.13 (default/linux/x86/2008.0, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.30-gentoo-r4 i686)
=================================================================
System uname: Linux-2.6.30-gentoo-r4-i686-Intel-R-_Core-TM-2_Duo_CPU_T5550_@_1.83GHz-with-gentoo-1.12.11.1
Timestamp of tree: Tue, 08 Sep 2009 01:45:02 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.6.2-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=core2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O3 -march=core2 -pipe"
DISTDIR="/store/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo                 ftp://ftp.unina.it/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="it"
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="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X aalib acl acpi alsa bash-completion berkdb branding bzip2 cairo cdda cddb cdr cli cracklib crypt cxx dbus dga dri dvd dvdr encode exif fbcon ffmpeg fontconfig ftp fuse gd gdbm gif gimp gnome gnome-keyring gnutls gpm gstreamer gtk hal hddtemp iconv ieee1394 isdnlog java javascript jpeg jpeg2k lame lcms lm_sensors lzma matroska mime mmap mmx mng mp3 mp4 mpeg mudflap nautilus ncurses nfs nls nptl nptlonly nsplugin offensive ogg opengl openmp pam pch pcmcia pcre pdf perl png posix pppd python readline reflection samba sdl session sharedmem smp sockets spell spl sse sse2 sse3 ssl svg sysfs syslog sysvipc taglib tcpd threads tiff truetype unicode usb v4l v4l2 vorbis wifi x86 xattr xorg xpm xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 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" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" USERLAND="GNU" VIDEO_CARDS="intel"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Raffaello D. Di Napoli 2009-09-08 22:36:35 UTC
Created attachment 203547 [details, diff]
Changes #!/bin/sh to #!/bin/bash

move_tmp_persistent_rules.sh sources /etc/init.d/functions.sh (for ebegin and eend), which is entirely bash-dependent, so there’s little to do about it but make explicit its dependency on bash.
Comment 2 Matthias Schwarzott gentoo-dev 2009-09-09 07:11:06 UTC
My version of /lib/udev/move_tmp_persistent_rules.sh does ". /etc/init.d/functions.sh" and this works without problems:

# dash /lib/udev/move_tmp_persistent_rules.sh

So I think your problem is, you try using dash as system shell, but still use baselayout-1. This combination is NOT supported.
Update to baselayout-2 with openrc and it will work.
Comment 3 Raffaello D. Di Napoli 2009-09-10 05:19:27 UTC
(In reply to comment #2)
> My version of /lib/udev/move_tmp_persistent_rules.sh does ".
> /etc/init.d/functions.sh" and this works without problems:
> 
> # dash /lib/udev/move_tmp_persistent_rules.sh
> 
> So I think your problem is, you try using dash as system shell, but still use
> baselayout-1. This combination is NOT supported.
> Update to baselayout-2 with openrc and it will work.

Aha, I see.
I now switched to OpenRC and baselayout-2, and yes, it does work for me too.
Thank you all for the assistance.