Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 62086

Summary: xinit forces .xinitrc to run with /bin/sh
Product: Gentoo Linux Reporter: Carlo von Loesch <lynx>
Component: Current packagesAssignee: Gentoo X packagers <x11>
Status: RESOLVED FIXED    
Severity: minor Keywords: Inclusion
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Carlo von Loesch 2004-08-29 04:17:10 UTC
When the .xinitrc has mode +x, xinit will traditionally exec the script rather
than launch /bin/sh on it. So you can use perl or in my case a #!/bin/tcsh
with the purpose of having all my tcsh environment variables properly set up
for all X applications.

With the current /etc/X11/xinit/xinitrc this feature is broken.


Reproducible: Always
Steps to Reproduce:
1. put #!/usr/bin/perl in your .xinitrc
2. xinit

Actual Results:  
syntax errors because /bin/sh cannot parse perl


I changed /etc/X11/xinit/xinitrc like this, and thus fixed the bug:


if [ -f "$HOME/.xinitrc" ]; then
        XINITRC="$HOME/.xinitrc"
        if [ -e $XINITRC ]; then
                # if the x bit is set on .xinitrc
                # it means the xinitrc is not a
                # shell script but something else
                exec $XINITRC
        fi
        exec /bin/sh $XINITRC
# If not present, try the system default
...
Comment 1 Donnie Berkholz (RETIRED) gentoo-dev 2006-04-19 22:30:45 UTC
Fixed, finally! In xinit-1.0.2-r1.