Bug 176548 - net-proxy/dante-1.1.19: /etc/init.d/dante-sockd errors (maybe due to sys-apps/baselayout-2.0.0_alpha1)
|
Bug#:
176548
|
Product: Gentoo Linux
|
Version: unspecified
|
Platform: All
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: normal
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: net-proxy@gentoo.org
|
Reported By: alessandro.guido+bugzilla@gmail.com
|
|
Component: baselayout
|
|
|
URL:
|
|
Summary: net-proxy/dante-1.1.19: /etc/init.d/dante-sockd errors (maybe due to sys-apps/baselayout-2.0.0_alpha1)
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2007-04-30 11:13 0000
|
at boot, reboot or whenever I launch an init script, I get this error messages:
/etc/init.d/dante-sockd: line 7: [: : integer expression expected
/etc/init.d/dante-sockd: line 8: [: : integer expression expected
/etc/init.d/dante-sockd: line 9: [: : integer expression expected
(probably due to sys-apps/baselayout-2.0.0_alpha1)
Reproducible: Always
$ emerge --info
Portage 2.1.2.5 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.5-r1,
2.6.21-cfs-v7 i686)
=================================================================
System uname: 2.6.21-cfs-v7 i686 Intel(R) Pentium(R) M processor 1.86GHz
Gentoo Base System release 2.0.0_alpha1
Timestamp of tree: Mon, 30 Apr 2007 07:00:10 +0000
dev-java/java-config: 1.3.7, 2.0.31-r7
dev-lang/python: 2.5-r2
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox: 1.2.18.1
sys-devel/autoconf: 2.13, 2.61
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils: 2.17.50.0.14
sys-devel/gcc-config: 1.3.16
sys-devel/libtool: 1.5.23b
virtual/os-headers: 2.6.20-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-pipe -O2 -march=pentium-m -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf
/etc/java-config/vms/ /etc/php/apache1-php4/ext-active/
/etc/php/apache2-php4/ext-active/ /etc/php/cgi-php4/ext-active/
/etc/php/cli-php4/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-pipe -O2 -march=pentium-m -fomit-frame-pointer
-fvisibility-inlines-hidden -fvisibility=hidden"
DISTDIR="/var/portage/distfiles"
FEATURES="distlocks metadata-transfer nodoc noinfo parallel-fetch sandbox
sfperms strict tmpfs"
GENTOO_MIRRORS="ftp://pandemonium.tiscali.de/pub/gentoo/"
LANG="it_IT.UTF-8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,--as-needed"
LINGUAS="it"
MAKEOPTS="--quiet"
PKGDIR="/var/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --delete-after --stats --timeout=180
--exclude=/distfiles --exclude=/local --exclude=/packages
--filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acpi apache2 bitmap-fonts cairo cdr cli dbus dvd dvdr dvdread emboss evo
firefox gif gnome gstreamer hal isdnlog jpeg libg++ libnotify mad midi mikmod
mmx mp3 nls nptl nptlonly ogg opengl pdf png pppd qt3support quicktime
reflection session spl sse sse2 startup-notification svg threads truetype-fonts
type1-fonts udev unicode vorbis win32codecs x86 xinerama xml xorg xv 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 mulaw multi null plug rate route
share shm softvol" CAMERAS="ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse
synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780
lb216 lcdm001 mtxorb ncurses text" LINGUAS="it" USERLAND="GNU"
VIDEO_CARDS="none nvidia"
Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS,
PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Yeah, those are invalid tests.
You should either test to see if there's a value there
[ -n "${foo}" ]
or give it a default if it's not
[ "${foo:-0}" -gt 1 ]
I don't understand why is this net-proxy's bug. dante installs a
/etc/conf.d/dante-sockd file in which all these parameters are set.
But have it your way. Fixed by imposing a default value to all those
parameters.
Revision has been bumped with the same keywords as 1.1.19.
(In reply to comment #2)
> I don't understand why is this net-proxy's bug. dante installs a
> /etc/conf.d/dante-sockd file in which all these parameters are set.
Well it's hardly base-systems bug when we don't care about the config nor the
init script.
baselayout-2 calls bash via /bin/sh which imposes a few more POSIX restrictions
on how you write shell scripts. Basically it's not as forgiving to any errors.
Still, those parameters should have values at that point. Regardless of the
shell that executes them, writing:
conf.d script: foo=1
init.d script: [ $foo -eq 1 ]
or
conf.d script: foo=0
init.d script: [ ${foo:-0} -eq 1 ]
should have the exact same result.
Say that the config file doesn't exist or user has commented value out? Should
base-system still be to blame? Or maybe then you would pick on the user?
roy@uberlaptop ~ $ [ "${nodefined}" -eq 1 ]
-bash: [: : integer expression expected
roy@uberlaptop ~ $ [ "${nodefined:-0}" -eq 1 ]
roy@uberlaptop ~ $
Or maybe you could do this
[ "${nodefined}" = 1 ]
That only works for a string comparison, obviously not for integer comparisons.
Or maybe a value is required, at which point you should exit gracefully with a
descriptive error.
@reporter: Do you have the /etc/conf.d/dante-sockd file? What non-comment lines
do you have in it?
iro@odino ~ $ cat /etc/conf.d/dante-sockd | grep -v '^#'
SOCKD_FORKDEPTH=1
SOCKD_DEBUG=0
SOCKD_DISABLE_KEEPALIVE=1
Q.E.D.
This shows that conf.d file hasn't been executed before init.d file.
You're right, when we generate our dependency tree we do load the init script
before the config but when we execute a script we do it the other way around.
This has been corrected and will appear in alpha2.
However, my argument about checking variables before doing integer evaluation
still stands :)