Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 68663 - rc-update and awk don't work together anymore (with tcsh and kde)
Summary: rc-update and awk don't work together anymore (with tcsh and kde)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-23 16:54 UTC by Markus Baumeister
Modified: 2005-01-02 07:03 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 Markus Baumeister 2004-10-23 16:54:17 UTC
Behaviour of rc-update is as follows:

---- snip ----
bash-2.05b# rc-update add vixie-cron nonetwork
 * vixie-cron added to runlevel nonetwork
 * Caching service dependencies...
gawk: /lib/rcscripts/awk/cachedepends.awk:168: fatal: Invalid preceding regular expression: /{/
/var/lib/init.d/depcache: /var/lib/init.d/depcache: No such file or directory
 * rc-update complete.
---- snip -----
This is caused by seemingly missing '\' before '{' and '}' in /lib/rcscripts/awk/cachedepends.awk around lines 168-173. But if one fixes that one gets more complaints:
----- snip -----
bash-2.05b# rc-update del vixie-cron nonetwork
 * vixie-cron removed from the following runlevels: nonetwork
 * Caching service dependencies...
gawk: /lib/rcscripts/awk/cachedepends.awk:73: fatal: function `extension' not defined
/var/lib/init.d/depcache: /var/lib/init.d/depcache: No such file or directory
 * rc-update complete.
------------ snip -----------

Since rc-update work fine a few days before I would guess that the new baselayout broke things.



Reproducible: Always
Steps to Reproduce:
see above


Expected Results:  
no error?
I hope my constant adding and removing vixie-cron didn't lastingly messed up my
configuration.

*  sys-apps/baselayout
      Latest version available: 1.9.4-r6
      Latest version installed: 1.9.4-r6

*  sys-apps/gawk
      Latest version available: 3.1.3-r1
      Latest version installed: 3.1.3-r1


emerge info:
Portage 2.0.51-r2 (default-x86-2004.2, gcc-3.3.4, glibc-2.3.4.20040808-r1,
2.6.9-gentoo-r1P3 i686)
=================================================================
System uname: 2.6.9-gentoo-r1P3 i686 Intel(R) Pentium(R) M processor 1300MHz
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers:  sys-kernel/linux-headers-2.4.21-r1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium3 -frename-registers -mfpmath=sse -fomit-frame-pointer
-pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -frename-registers -mfpmath=sse
-fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks sandbox"
GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
http://www.gigaload.org/gentoo.org/ http://gentoo.tiscali.nl/gentoo/
http://ftp.easynet.nl/mirror/gentoo/"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X acpi alsa apache2 avi berkdb bitmap-fonts bzlib cdr crypt cups dga
divx4linux dvd encode esd ethereal exif f77 foomaticdb ftp gdbm gif gnutls
gphoto2 gpm gtk gtk2 guile imagemagick imlib java jpeg kde libg++ libwww mbox
mikmod mime mmx motif mozilla mpeg mysql ncurses nis nls offensive oggvorbis
opengl pam pcmcia pdflib perl php png pnp posix python qt quicktime readline
samba sdl slang socketsi spell sse ssl svga sysvipc tcpd tetex tiff truetype
trusted usb wxwindows x86 xface xine xml2 xmms xprint xv xvid zlib"
Comment 1 Markus Baumeister 2004-10-23 17:47:31 UTC
Sorry for implicating baselayout, things seem to be more complicated:

1) login on console; su; rc-update : Works
2) login on console; startx (starts kde via xinitrc); su in xterm; rc-update: Works
3) login via kdm (to kde desktop); su in xterm; rc-update: Problems as listed above.
(everything using tcsh)

Diffing the 'env's of approach 2 & 3 have only one promising entry. On Path 3) someone set 'POSIXLY_CORRECT=y'. If I unset that environement variable, things work again.

So either baselayout has to become POSIX-conform. Or whatever sets POSIXLY_CORRECT in case 3) has to be fixed.

BTW, I'm unsure if this bug has relations to bug 63059 (http://bugs.gentoo.org/show_bug.cgi?id=63059). I applied the fix proposed there to /usr/kde/3.3/share/config/kdm/Xsession (but the changes looks as if it removes env variables not add them).
Comment 2 SpanKY gentoo-dev 2004-10-23 21:37:32 UTC
looks like a KDE prob

posix support is something we'll add to baselayout if it's a simple fix, but we're not going to bend over backwards for it
Comment 3 Markus Baumeister 2004-10-24 04:28:07 UTC
I'm not so sure if it really is a kde error. I fgreped my whole filesystem for POSIXLY_CORRECT and there were only two scripts which obviously set it (/usr/lib/perl5/5.8.4/Getopt/Long.pm and /usr/lib/python2.3/test/test_getopt.py) . Of the binary files containing the term, none was specifically kde-related.

Nevertheless the simple fix I finally settled for is to add

unsetenv POSIXLY_CORRECT

to .cshrc . Maybe this could be added to the next version of the global .cshrc (which seems to be /etc/csh.cshrc). Since baselayout is not POSIX conform it is not only a hotfix but even correct. 

[I changed the summary line a bit since it is more about tcsh, kde and awk than about rc-update. Other scripts (e.g. emerge) break as well.]
Comment 4 Gregorio Guidi (RETIRED) gentoo-dev 2004-11-04 05:11:07 UTC
Could you try removing the lines "set -a" and "set +a" in
/usr/kde/3.3/share/config/kdm/Xsession (around lines 32-34)
I'm fairly sure the problem is there.

Try also using this line instead of line 33.

eval `$SHELL -c 'if (-f /etc/csh.login) source /etc/csh.login > /dev/null; if (-f ~/.login) source ~/.login > /dev/null; /bin/sh -c export'

This is how the Xsession script will look for kde 3.3.2, so if it fixes the
problem we just have to wait for the next release.
Comment 5 Stefan Kiesler 2004-11-04 19:22:04 UTC
I'm also having that kdm/tcsh problem descibed in bug 63059 and also applied the SHELLOPTS|GROUPS Xsession patch. Removing set -a and set +a fixes the POSIXLY_CORRECT problem for me, as it gets no longer set.

So far so good, but that new eval line is just making things worse than ever. No matter if the set +/-a lines are active or commented out, including the new eval line kdm completely fails to login. The tcsh bug strikes back, I thought, but this time it's more evil. Now I can't even login as root anymore! That's especially weird as my root shell ain't tcsh, but bash.

Summary:
The perfect way for me to solve the tcsh bug, have that strange POSIXLY_CORRECT not set and get emerge, rc-update and co working again is the following modification in /usr/kde/3.3/share/config/kdm/Xsession:

In the */csh|*/tcsh) section replace

    set -a
    eval `$SHELL -c 'if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c set | egrep
 -v "^(BASH_VERSINFO|EUID|PPID|UID|_)="'`
    set +a

with

    eval `$SHELL -c 'if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c set | egrep
-v "^(BASH_VERSINFO|EUID|PPID|UID|SHELLOPTS|GROUPS|_)="'`

@Markus: Could you also try removing the "unsetenv POSIXLY_CORRECT" from your .cshrc and see if removing the set lines fixes the problem for you?
Comment 6 Gregorio Guidi (RETIRED) gentoo-dev 2004-11-05 02:23:42 UTC
> So far so good, but that new eval line is just making things worse than ever.

Whops, I just missed a backtick when doing copy-paste... all should be well
when 3.3.2 comes out.
Comment 7 Markus Baumeister 2004-11-06 06:04:15 UTC
Removing the set commands (and of course the unsetenv POSIXLY_CORRECT) but leaving the (already patched) line 33 works.
In addition replacing line 33 (including the missing '`' at the end) also works. 
Comment 8 Gregorio Guidi (RETIRED) gentoo-dev 2005-01-02 07:03:34 UTC
All should be ok now, reopen if not.