/sbin/runscript.sh doesn't allow --nocolor as an option when running as a non-root user and executing the status command. aaron@epic ~ $ /etc/init.d/net.eth2 status * status: started aaron@epic ~ $ /etc/init.d/net.eth2 status --nocolor * /sbin/runscript.sh: must be root to run init scripts aaron@epic ~ $ /etc/init.d/net.eth2 --nocolor status * /sbin/runscript.sh: must be root to run init scripts The file /sbin/runscript.sh has this block starting at line 10: # User must be root to run most script stuff (except status) if [[ ${EUID} != "0" ]] && ! [[ $2 == "status" && $# -eq 2 ]] && \ ! [[ $2 == "--quiet" && $3 == "status" && $# -eq 3 ]] && \ ! [[ $3 == "--quiet" && $2 == "status" && $# -eq 3 ]] \ ; then eerror "$0: must be root to run init scripts" exit 1 fi Reproducible: Always Steps to Reproduce: 1. Run any init script that uses /sbin/runscript.sh as non-root user with "status" and "--nocolor" as arguments Actual Results: /sbin/runscript.sh: must be root to run init scripts Expected Results: status: started Portage 2.1.4.5 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r8 i686) ================================================================= System uname: 2.6.25-gentoo-r8 i686 Intel(R) Pentium(R) D CPU 3.20GHz Timestamp of tree: Thu, 16 Oct 2008 05:20:01 +0000 app-shells/bash: 3.2_p33 dev-lang/python: 2.4.4-r13, 2.5.2-r7 dev-python/pycrypto: 2.0.1-r6 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.61-r2 sys-devel/automake: 1.9.6-r2, 1.10.1-r1 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.23-r3 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=i686 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-O2 -march=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://gentoo.portlandcomputerguys.com/gentoo" LDFLAGS="-Wl,-O1" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" 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" SYNC="rsync://gentoo.portlandcomputerguys.com/gentoo-portage" USE="acl berkdb bzip2 caps cgi cli cracklib crypt ctype curl dri fam fastcgi fortran ftp gd gdbm gpm hash iconv iproute2 ipv6 isdnlog midi mudflap multiuser mysql mysqli ncurses network-cron nls nptl nptlonly openmp pam pcre perl php pppd python readline reflection session sockets spell spl ssl swat sysfs tcpd threads truetype unicode usb vchroot x86 xattr xml xmlrpc xorg 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Created attachment 169246 [details, diff] Patch that allows --nocolor as an option with status command
i changed it to just check via: if [[ ${EUID} != "0" ]] && [[ " $* " != " status " ]] ; then