LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-11-2008, 10:59 PM   #1
greengrocer
Member
 
Registered: Aug 2005
Distribution: Ubuntu Intrepid and Meerkat, formerly used Debian 3.1 (Sarge) with Gnome Desktop
Posts: 353

Rep: Reputation: 37
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
 
Old 04-11-2008, 11:10 PM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Why don't you just configure it to boot to runlevel 5 for x?
 
Old 04-11-2008, 11:20 PM   #3
Kahless
Member
 
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Rep: Reputation: 30
This is just a random guess... but why does it say exit? did you try removing that?
 
Old 04-12-2008, 03:19 AM   #4
greengrocer
Member
 
Registered: Aug 2005
Distribution: Ubuntu Intrepid and Meerkat, formerly used Debian 3.1 (Sarge) with Gnome Desktop
Posts: 353

Original Poster
Rep: Reputation: 37
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?
 
Old 04-12-2008, 11:41 AM   #5
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Quote:
Originally Posted by greengrocer View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh remote login - how to source .bashrc automatically newsgroupie2003 Linux - General 2 08-16-2005 04:49 AM
Stop X from starting automatically dafatdude Linux - Software 1 07-26-2005 09:30 PM
not starting automatically ??? JNaas Linux - Networking 0 09-30-2004 07:25 PM
starting programs in .bashrc bluemoose Linux - Newbie 1 07-27-2003 02:30 PM
Starting X Automatically shari Linux - Software 2 08-08-2001 01:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration