LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bashrc and starting xorg automatically (https://www.linuxquestions.org/questions/linux-newbie-8/bashrc-and-starting-xorg-automatically-634803/)

greengrocer 04-11-2008 10:59 PM

bashrc and starting xorg automatically
 
Hello all,

I hope someone can assist. I am using Debian 4 at present.

I have created a new user called "user" and this user has a home directory at /home/user.

I am having some trouble getting xfce to start properly from the .bashrc file when 'user' logs in.

I can start xfce automatically if I log in and type "startx" from the command line. xorg and xfce seem to work flawlessly if I do that.

The .bashrc file for 'user' looks like this:

Code:

# ~/.bashrc: executed by bash(1) for non-login shells.

export PS1='\h:\w\$ '
umask 022

# You may uncomment the following lines if you want `ls' to be colorized:
 export LS_OPTIONS='--color=auto'
 eval "`dircolors`"
 alias ls='ls $LS_OPTIONS'
 alias ll='ls $LS_OPTIONS -l'
 alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'

case `/usr/bin/tty` in /dev/tty[0-9]*)
        XPID=$(/bin/pidof xinit)
        if [ -z "$XPID"] ; then
                startx -nolisten tcp; exit
        fi
esac

When 'user' logs in, xfce commences to start (which would indicate that the .bashrc file is being executed), however the moment the xfce desktop tries to appear on the screen, xfce exits and 'user' is logged out.

The thing here that I find so strange is that if 'user' manually types "startx", then xfce works fine.

Any suggestions on how to fix would be really appreciated because I am a little bit lost at the moment.

Regards,
Greenie

AceofSpades19 04-11-2008 11:10 PM

Why don't you just configure it to boot to runlevel 5 for x?

Kahless 04-11-2008 11:20 PM

This is just a random guess... but why does it say exit? did you try removing that?

greengrocer 04-12-2008 03:19 AM

I got rid of the "-nolisten tcp" switch and it worked.

Quote:

Why don't you just configure it to boot to runlevel 5 for x?
HOw would I do that? would that involve adding some sort of script to rc5.d?

AceofSpades19 04-12-2008 11:41 AM

Quote:

Originally Posted by greengrocer (Post 3118756)
I got rid of the "-nolisten tcp" switch and it worked.



HOw would I do that? would that involve adding some sort of script to rc5.d?

If you change inittab to run level 5 it will start x automatically. It might not be runlevel 5 in debian, but you can google for it


All times are GMT -5. The time now is 02:15 PM.