Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 350606 - net-misc/dhcpcd-5.2.9 gives /sbin/rc-service: invalid option -- 'D'
Summary: net-misc/dhcpcd-5.2.9 gives /sbin/rc-service: invalid option -- 'D'
Status: RESOLVED DUPLICATE of bug 349180
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL: http://roy.marples.name/archives/dhcp...
Whiteboard:
Keywords:
: 350637 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-04 23:25 UTC by niv
Modified: 2011-01-06 04:15 UTC (History)
0 users

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 niv 2011-01-04 23:25:47 UTC
From: Roy Marples <roy@marples.name>
Date: Mon 03 Jan 2011 - 00:22:00 GMT

On Sun, 2011-01-02 at 23:44 +0200, Niv Wiser wrote:
> yes, my /bin/sh points to bash
>
> ls -l /bin/sh
> lrwxrwxrwx 1 root root 4 Dec 2 11:11 /bin/sh -> bash

Well, file a Gentoo bug about it then. I don't use Gentoo anymore, or
OpenRC and that command used to work fine. 

Reproducible: Always

Steps to Reproduce:
I installed net-misc/dhcpcd-5.2.9 sys-apps/baselayout-2.0.1 app-shells/bash-4.1_p7
when I issue /sbin/dhcpcd I get the error in the subject.
I did add this file:
#/lib/dhcpcd/dhcpcd-hooks/60-l2tp.conf
#use ISP default gateway as a route for l2tp server
#written by niv vaizer
set -x
#>/dev/null 2>&1
[ -f /etc/conf.d/strongVpn ] && . /etc/conf.d/strongVpn
LOG="/tmp/60-l2tp.conf.log"
if [ $DEBUG -ge 1 ] ; then
	echo "----------------------------------">>$LOG
	echo "`date '+%H:%M:%S_%d.%m.%Y'` invoked">>$LOG
	set >>$LOG
fi

if [ "$interface" = "$WAN_DEV" -a "$if_up" = "true" ] ; then

	[ -n "${new_routers}" ] &&ip ro | grep -q "${VPN_HOST} via ${new_routers}"
	if [ $? -ne 0 ] ; then
		line=$(ip ro | grep "${VPN_HOST} via")
		line=${line%%dev*}
		[ -n "${line}" ] && ip ro del ${line}
		ip ro add "$VPN_HOST" via "$new_routers" 
	fi
	grep -q $new_ip_address /etc/ipsec.conf
	if [ $? -ne 0 ] ; then
		sed -i "s/left=.*/left=$new_ip_address/" /etc/ipsec.conf
		sed -i "s/.*\ :/$new_ip_address $VPN_HOST \:/" /etc/ipsec.secrets
	fi
fi
Actual Results:  
/sbin/dhcpcd 
dhcpcd[9338]: version 5.2.9 starting
++ '[' -f /etc/conf.d/strongVpn ']'
++ . /etc/conf.d/strongVpn
+++ VPN_HOST=98.158.112.57
+++ WAN_DEV=eth0
+++ WAN_GW=kept private
+++ CONN=L2TP-PSK
+++ USERNAME=kept private
+++ IFACE=ppp0
+++ PID=/var/run/strongVpn.pid
+++ DEBUG=3
++ LOG=/tmp/60-l2tp.conf.log
++ '[' 3 -ge 1 ']'
++ echo ----------------------------------
+++ date +%H:%M:%S_%d.%m.%Y
++ echo '01:10:47_05.01.2011 invoked'
++ set
++ '[' eth0 = eth0 -a false = true ']'
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
++ '[' -f /etc/conf.d/strongVpn ']'
++ . /etc/conf.d/strongVpn
+++ VPN_HOST=98.158.112.57
+++ WAN_DEV=eth0
+++ WAN_GW=kept private
+++ CONN=L2TP-PSK
+++ USERNAME=kept private
+++ IFACE=ppp0
+++ PID=/var/run/strongVpn.pid
+++ DEBUG=3
++ LOG=/tmp/60-l2tp.conf.log
++ '[' 3 -ge 1 ']'
++ echo ----------------------------------
+++ date +%H:%M:%S_%d.%m.%Y
++ echo '01:10:47_05.01.2011 invoked'
++ set
++ '[' eth0 = eth0 -a false = true ']'
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[9338]: eth0: rebinding lease of kept private
dhcpcd[9338]: eth0: acknowledged kept private from 213.57.35.2
dhcpcd[9338]: eth0: checking for kept private
dhcpcd[9338]: eth0: leased kept private for 72497 seconds
dhcpcd: eth0: MTU set to 576
/sbin/rc-service: invalid option -- 'D'
Usage: rc-service [options] 

Options: [e:ilr:Chqv]
  -e, --exists <arg>                tests if the service exists or not
  -i, --ifexists                    if the service exsits then run the command
  -l, --list                        list all available services
  -r, --resolve <arg>               resolve the service name to an init script
  -h, --help                        Display this help output
  -C, --nocolor                     Disable color output
  -v, --verbose                     Run verbosely
  -q, --quiet                       Run quietly
/sbin/rc-service: invalid option -- 'D'
Usage: rc-service [options] 

Options: [e:ilr:Chqv]
  -e, --exists <arg>                tests if the service exists or not
  -i, --ifexists                    if the service exsits then run the command
  -l, --list                        list all available services
  -r, --resolve <arg>               resolve the service name to an init script
  -h, --help                        Display this help output
  -C, --nocolor                     Disable color output
  -v, --verbose                     Run verbosely
  -q, --quiet                       Run quietly
++ '[' -f /etc/conf.d/strongVpn ']'
++ . /etc/conf.d/strongVpn
+++ VPN_HOST=98.158.112.57
+++ WAN_DEV=eth0
+++ WAN_GW=kept private
+++ CONN=L2TP-PSK
+++ USERNAME=kept private
+++ IFACE=ppp0
+++ PID=/var/run/strongVpn.pid
+++ DEBUG=3
++ LOG=/tmp/60-l2tp.conf.log
++ '[' 3 -ge 1 ']'
++ echo ----------------------------------
+++ date +%H:%M:%S_%d.%m.%Y
++ echo '01:10:52_05.01.2011 invoked'
++ set
++ '[' eth0 = eth0 -a true = true ']'
++ '[' -n <GWIP> ']'
++ grep -q '98.158.112.57 via <GWIP>'
++ ip ro
++ '[' 1 -ne 0 ']'
+++ ip ro
+++ grep '98.158.112.57 via'
++ line=
++ line=
++ '[' -n '' ']'
++ ip ro add 98.158.112.57 via GWIP
++ grep -q PRIVATEIP /etc/ipsec.conf
++ '[' 1 -ne 0 ']'
++ sed -i 's/left=.*/left=PRIVATEIP/' /etc/ipsec.conf
++ sed -i 's/.*\ :/PRIVATEIP 98.158.112.57 \:/' /etc/ipsec.secrets
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[9338]: forked to background, child pid 9457


Expected Results:  
in http://roy.marples.name/archives/dhcpcd-discuss/2011/0277.html
roy marpels states that he tested dhcpcd on a gentoo box and it didnt give this error, so what am I doing wrong?

 emerge --info
Portage 2.1.9.25 (default/linux/x86/10.0, gcc-4.4.4, glibc-2.11.2-r3, 2.6.36-gentoo-r5 i686)
=================================================================
System uname: Linux-2.6.36-gentoo-r5-i686-Intel-R-_Pentium-R-_4_CPU_2.80GHz-with-gentoo-2.0.1
Timestamp of tree: Tue, 04 Jan 2011 08:45:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
app-shells/bash:     4.1_p7
dev-java/java-config: 1.3.7-r1, 2.1.11-r1
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     9999
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.1.2, 4.3.4, 4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* @EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/fax /usr/share/config /usr/share/openvpn/easy-rsa /var/spool/fax/etc"
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=prescott -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"
GENTOO_MIRRORS="http://mirror.ovh.net/gentoo-distfiles/ http://mirror.switch.ch/ftp/mirror/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://mirror.hamakor.org.il/pub/mirrors/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo"
LANG="en_US.UTF-8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
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/layman/sunrise /usr/local/portage/layman/tante /usr/local/portage/layman/zugaina /usr/local/portage_overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aac acl acpi alsa amr avahi berkdb bidi bluetooth bzip2 cairo caps cdparanoia cli cracklib crypt cups cxx dbus djvu dri dts fbcon ffmpeg flac fortran gdbm gif gpm gsm gstreamer gtk hal iconv jack jpeg laptop ldap lirc mjpeg mmx modules mp3 mp4 mudflap mysql ncurses nls nptl nptlonly opengl openmp pam pcre perl png pppd pulseaudio python qt4 readline samba semantic-desktop session speex spell sse sse2 ssl sysfs tcpd theora tiff truetype unicode usb v4l v4l2 vorbis win32codecs x264 x86 xcomposite xinerama xorg 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 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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DVB_CARDS="tda1004x tda10045 tda10046" 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIRC_DEVICES="hauppauge devinput" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon v4l displaylink" 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, FFLAGS, INSTALL_MASK, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Rafał Mużyło 2011-01-05 08:04:35 UTC
*** Bug 350637 has been marked as a duplicate of this bug. ***
Comment 2 Rafał Mużyło 2011-01-05 08:07:57 UTC
I'd check your configuration files for dhcpcd, syntax has changed a bit.
Comment 3 niv 2011-01-05 22:01:30 UTC
after establishing ppp0 I see that /etc/resolv.conf wasnt updated , so I manually run it:
# resolvconf -a ppp0 </etc/resolv.conf.strongvpn 
/sbin/rc-service: invalid option -- 'D'
Usage: rc-service [options] 

Options: [e:ilr:Chqv]
  -e, --exists <arg>                tests if the service exists or not
  -i, --ifexists                    if the service exsits then run the command
  -l, --list                        list all available services
  -r, --resolve <arg>               resolve the service name to an init script
  -h, --help                        Display this help output
  -C, --nocolor                     Disable color output
  -v, --verbose                     Run verbosely
  -q, --quiet                       Run quietly
/sbin/rc-service: invalid option -- 'D'
Usage: rc-service [options] 

Options: [e:ilr:Chqv]
  -e, --exists <arg>                tests if the service exists or not
  -i, --ifexists                    if the service exsits then run the command
  -l, --list                        list all available services
  -r, --resolve <arg>               resolve the service name to an init script
  -h, --help                        Display this help output
  -C, --nocolor                     Disable color output
  -v, --verbose                     Run verbosely
  -q, --quiet                       Run quietly


1. was it openresolv that caused this issue in the first place?
2. how can I find the cause to this? is there a debug flag? or should I set +x somewhere?
Comment 4 niv 2011-01-05 22:36:15 UTC
this seems relevent
http://bugs.gentoo.org/show_bug.cgi?id=349180
Comment 5 Rafał Mużyło 2011-01-06 02:10:45 UTC
(In reply to comment #4)
> this seems relevent
> http://bugs.gentoo.org/show_bug.cgi?id=349180
> 

You're probably right. Test with new release.
Comment 6 Jory A. Pratt gentoo-dev 2011-01-06 04:15:15 UTC

*** This bug has been marked as a duplicate of bug 349180 ***