Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 09-03-2005, 11:28 AM   #1
Registered: Jun 2004
Location: Canada
Distribution: Slackware 10.0
Posts: 80

Rep: Reputation: 15
starting desktop automatically for a user


My system is configured to start at level 3.
However, I would like KDE (for example) to start automatically if it is my daughter who is logged in.

I wanted to add "startx" in .bash_profile, but it is probably a bad idea, since it is executed each time a console is loaded.

Any idea ? Thanks in advance
Old 09-03-2005, 11:38 AM   #2
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Rep: Reputation: 30
change the default runlevel to 5 (i think) in /etc/inittab

Also, make sure that GDM of KDM is installed and running at startup.

Old 09-03-2005, 12:00 PM   #3
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
If you want to keep it booting to level 3 for you and level 5 for your daughter, I would make another entry in the lilo.conf or grub.conf with init 5 on the end.
For example:

Set the default to your daughter so she doesn't have to fuss with it.

title Fedora Core Daughter
root (hd1,1)
kernel /boot/vmlinuz-2.6.12-1.1447_FC4 ro root=LABEL=/ rhgb quiet init 5
initrd /boot/initrd-2.6.12-1.1447_FC4.img

title Fedora Core Yours
root (hd1,1)
kernel /boot/vmlinuz-2.6.12-1.1447_FC4 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.12-1.1447_FC4.img
Old 09-03-2005, 01:05 PM   #4
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Actually your original idea about using .bash_profile may be sound. The following is a quote from here

~/.bash_profile is read, and the commands within executed, every time you log onto the system. It is NOT read whenever any subshells are started. In fact, if you set your $PS1 variable here, it will likely be clobbered (read set to something else) when you start another subshell. Chances are you will start other subshells.

~/.bashrc is read whenever a new bash shell is started. It is not read when you start your login shell.
So if I'm reading that right, starx in your .bash_profile should only execute when your daughter logs on. It is .bashrc that is executed every time a shell is opened.
Old 09-04-2005, 10:05 AM   #5
Registered: Jun 2004
Location: Canada
Distribution: Slackware 10.0
Posts: 80

Original Poster
Rep: Reputation: 15
I made a simple test with a single line (Echo "hello world") in bash_profile. Then, I started a console within KDE, and I could see that bash_profile was executed...!

So, Homey's idea is probably the best one for now !



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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Preventing X from starting automatically DeadlySin3 Linux - Newbie 6 04-11-2005 05:26 AM
Starting Internet Automatically? grazak Linux - Networking 1 03-27-2005 11:39 PM
not starting automatically ??? JNaas Linux - Networking 0 09-30-2004 07:25 PM
Automatically starting Kppp Gomi Linux - Newbie 1 05-18-2004 08:33 PM
Starting X Automatically shari Linux - Software 2 08-08-2001 01:11 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:44 PM.

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