Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 62086 - xinit forces .xinitrc to run with /bin/sh
Summary: xinit forces .xinitrc to run with /bin/sh
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2004-08-29 04:17 UTC by Carlo von Loesch
Modified: 2006-04-19 22:30 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 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.