Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 370211 - kde-base/konsole-4.6.2: default profile uses non-login bash shell, so /etc/profile is never sourced
Summary: kde-base/konsole-4.6.2: default profile uses non-login bash shell, so /etc/pr...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: AMD64 Linux
: Normal minor (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-05 23:19 UTC by Jacob Godserv
Modified: 2011-07-14 10:38 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 Jacob Godserv 2011-06-05 23:19:44 UTC
konsole needs to use 'bash -l' to get an interactive login bash shell, instead of just an interactive shell. Without this, bash completion, and a number of other installed Gentoo shell "add-ons", won't ever be sourced.

The workaround is to edit the default profile and add " -l" to the end of the shell line.

Reproducible: Always




 ~ $ emerge --info
Portage 2.1.9.42 (default/linux/amd64/10.0/desktop/kde, gcc-4.4.5, libc-0-r0, 2.6.38-gentoo-r6 x86_64)
=================================================================
System uname: Linux-2.6.38-gentoo-r6-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P8800_@_2.66GHz-with-gentoo-2.0.2
Timestamp of tree: Sun, 05 Jun 2011 19:30:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1-r1, 3.1.3-r1
dev-util/cmake:      2.8.4-r1
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.8.2-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1-r1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.82
sys-kernel/linux-headers: 2.6.36.1
sys-libs/glibc:      2.12.2
virtual/os-headers:  0
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -march=core2 -msse4.1 -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-2.2/conf /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-pipe -march=core2 -msse4.1 -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
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="/var/lib/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cjk cleartype cli consolekit corefonts cracklib crypt cups cxx dbus divx dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fortran gdbm gdu gif gpm gtk iconv ipv6 jpeg kde lame laptop lcms ldap libnotify lm_sensors mad mmx mmxext mng modules mp3 mp4 mpeg mtp mudflap multilib ncurses networkmanager nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd pulseaudio python qt3support qt4 readline resolvconf samba sdl session spell sse sse2 ssl ssse3 startup-notification svg sysfs syslog tcpd theora tiff truetype type1 udev unicode usb vorbis wifi x264 xcb xml xorg xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" 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" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" FOO2ZJS_DEVICES="km2430" 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="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa fbdev" 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, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2011-06-19 12:48:21 UTC
Yes, but normally you dont log in using konsole, right?

After logging out and logging back into KDE, you should have all your settings...
Comment 2 Jacob Godserv 2011-06-19 12:54:48 UTC
(In reply to comment #1)
> Yes, but normally you dont log in using konsole, right?
> 
> After logging out and logging back into KDE, you should have all your
> settings...

Yea, that will take care of some settings, but not all. For example, bash completion has been turned on for some time and Konsole doesn't seem to recognize that without "bash -l".
Comment 3 Jacob Godserv 2011-07-05 15:00:14 UTC
I really don't like being pesky, but I think this bug is getting ignored without good reason. Perhaps you're right; Konsole shouldn't run login bash shells. In that case, this issue lies deeper than Konsole. (Perhaps KDE isn't initializing a login shell environment for KDE as a whole, and so Konsole is lacking, thus the need for "-l"? Just guessing at this point.)

To see what I'm seeing, please try this:
1. Install git with bash-completion USE flag on
2. Turn on bash completion for git locally. (It shouldn't matter if it's global or local, but I use local.)
3. Open Konsole and try to run the bash function "__git_ps1". It shouldn't be found.
4. Open the profile editor and append "-l" to the shell command so bash is launched as a login shell.
5. Re-open Konsole. Run "__git_ps1", and note that it now works.
6. Removing "-l" once again from the shell command causes "__git_ps1" to not be found.
Comment 4 Marc Schiffbauer gentoo-dev 2011-07-05 15:52:54 UTC
I noticed that kde is different than (at least) gnome in that matter a while ago.

But which behavior is correct?

You can check if you have a login shell by running "shopt login_shell"

I tested it using several x-terminals:

konsole:
login_shell     off

gnome-terminal:
login_shell    	on

xterm:
login_shell     off

wterm:
login_shell     off


So which behavior is correct?
I did not check how this will look like when done in a gnome environment.
Comment 5 Jacob Godserv 2011-07-05 16:10:37 UTC
(In reply to comment #4)
> So which behavior is correct?

This is a good question. I'd guess the correct behavior would be to have KDE itself create the correct environment, and then have Konsole inherit it. After all, I've logged into KDE, and everything inside that is using the same login session.

I think I may report this upstream, if it hasn't already been done. That should provide a lot of answers.

> I did not check how this will look like when done in a gnome environment.

I don't understand "look like". I've always used GNOME until recently, when I decided to experiment with something new, so I might be able to answer this question.
Comment 6 Marc Schiffbauer gentoo-dev 2011-07-05 16:22:47 UTC
As you can see in my little experiment, it seems that not kde is special, but gnome is.

As it seems to me its only gnome where you got a login shell.

If you log into a gnome session, do you get a login-shell in xterm then? in konsole? in wterm or whatever other terminal app you might have installed?

I for example have this in my .bashrc:

# read /etc/profile if this is not a login shell
if ! shopt -q login_shell && [ -r /etc/profile ]; then
        . /etc/profile
fi
Comment 7 Jacob Godserv 2011-07-05 16:55:53 UTC
(In reply to comment #6)
> If you log into a gnome session, do you get a login-shell in xterm then? in
> konsole? in wterm or whatever other terminal app you might have installed?

Within GNOME, xterm reports:
login_shell off
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2011-07-14 10:38:02 UTC
I think the problem is within Gnome here. After all, opening a window does not constitute "logging in". If you really log out and log back in again, your environment should be ok with kde.