LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 03-13-2009, 06:37 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 48
Start Fluxbox session automatically


I am using Debian Lenny (5.0) with X installed. I also have fluxbox was my Window manger. I would like to achieve this:

When my system boots it should start X and then start fluxbox session automatically without entering login and password. This is for the purpose of creating a LiveCD.

Right now, after my system boots I have to manually login and type in "startx" on tty1 which launches X and starts fluxbox thereafter. I would like to ***automate** this very step.

I would try to avoid using any login mangers like xdm, gdm, kdm ,etc.

Thanks

Last edited by kushalkoolwal; 03-13-2009 at 08:36 PM.
 
Old 03-13-2009, 08:25 PM   #2
linuxdork
LQ Newbie
 
Registered: Jan 2005
Location: Virginia, USA
Distribution: suse 9.2
Posts: 23

Rep: Reputation: 15
This might be 'like' what you're looking for.

http://ubuntuforums.org/showthread.php?t=727947
 
Old 03-13-2009, 09:08 PM   #3
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by linuxdork View Post
This might be 'like' what you're looking for.

http://ubuntuforums.org/showthread.php?t=727947
Not quite. First of all I don't have:
Code:
/etc/event.d/tty1
even after installing rungetty package.
 
Old 03-13-2009, 09:13 PM   #4
manwithaplan
Member
 
Registered: Nov 2008
Location: ~/
Distribution: Arch || Sidux
Posts: 393

Rep: Reputation: 45
Check in your ~/ folder for a file called ".xinitrc" and add the this to it. If not there create the file

Code:
# echo "exec startfluxbox" >> ~/.xinitrc
This is all that is needed... and also make sure "xdm" or any other is runtime default at boot... or just startx

Last edited by manwithaplan; 03-13-2009 at 09:35 PM.
 
Old 03-13-2009, 10:17 PM   #5
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.1
Posts: 1,049

Rep: Reputation: 170Reputation: 170
This thread:

http://www.linuxquestions.org/questi...ut-gui-374338/

will show you how to autologin into runlevel 3.

For whatever user you decide to autologin as, put this (or something similar/suitable) in its ~/.bash_profile:

Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/vc/3 ]; then
startx
fi
This particular code checks to verify that a display is available (ie, x hasn't already been started) and the user has logged into tty3, so you may have to change the result of $(tty) to reflect what you have chosen.

As previously indicated, you may have to edit .xinitrc so that fluxbox starts when your user issues the command $startx. Fluxbox can also be started from the cli with the command $startfluxbox (instead of $startx)

cheers,
 
Old 03-13-2009, 10:20 PM   #6
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by manwithaplan View Post
Check in your ~/ folder for a file called ".xinitrc" and add the this to it. If not there create the file

Code:
# echo "exec startfluxbox" >> ~/.xinitrc
This is all that is needed... and also make sure "xdm" or any other is
runtime default at boot... or just startx
hi,

I get the part of .xinitrc to start fluxbox. However, I still need to start "startx" manually by typing in the command. And that's made me to post this question. I would like startx to be executed automatically towards the end of the boot process.

Quote:
Originally Posted by manwithaplan View Post
and also make sure "xdm" or any other is
runtime default at boot
I don't want to use any login managers like XDM

Thanks
 
Old 03-13-2009, 10:29 PM   #7
manwithaplan
Member
 
Registered: Nov 2008
Location: ~/
Distribution: Arch || Sidux
Posts: 393

Rep: Reputation: 45
Quote:
Originally Posted by kushalkoolwal View Post
I don't want to use any login managers like XDM
I can think of 2 possibilities...

1) You add a login manager and set it too auto login your user account

2) You write a script that uses "startx" and add it to runtime default in your init.d or rc.d etc ... etc.. depending on distro.

These are they only ways I can think that it would work. Intrested myself if I could bypass using gdm...
 
Old 03-13-2009, 10:36 PM   #8
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by mrclisdue View Post
Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/vc/3 ]; then
startx
fi
This particular code checks to verify that a display is available (ie, x hasn't already been started) and the user has logged into tty3,
cheers,
I think I am very close to finding the solution based on what you guys have told me. Although one of my major question still remains unanswered. How does the startx gets executed? I still think based on whatever everyone has suggested, I still need to login first (on a tty) and then only the startx would get executed. I wan't startx to get executed automatically without even logging in.
 
Old 03-13-2009, 11:28 PM   #9
manwithaplan
Member
 
Registered: Nov 2008
Location: ~/
Distribution: Arch || Sidux
Posts: 393

Rep: Reputation: 45
Maybe find a way to echo the runlevels on startup. If you need a tty open before startx, then trace.log your startup and then startx. At least you can see how the tty is initiated. You'll need to take in account of adding username and pass. Seems like alot of code to me.. I'd just load xdm and autologin.
 
Old 03-13-2009, 11:37 PM   #10
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by manwithaplan View Post
Maybe find a way to echo the runlevels on startup. If you need a tty open before startx, then trace.log your startup and then startx. At least you can see how the tty is initiated. You'll need to take in account of adding username and pass. Seems like alot of code to me.. I'd just load xdm and autologin.
Quote:
Originally Posted by manwithaplan View Post
I'd just load xdm and autologin.
That was my initial guess too. But if you search over Internet, XDM does not have any auto-login feature. They say "If you need autologin, then why do you need xdm".
 
Old 03-13-2009, 11:44 PM   #11
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.1
Posts: 1,049

Rep: Reputation: 170Reputation: 170
Unless I've seriously misunderstood your intentions, the link referred to in my first post instructs you on how to get a user autolog'd-in, in runlevel3 (ie, no xdm...)

Once that is accomplished, the autolog'd-in user's .bash_profile is sourced - the quote-back you used essentially establishes whether X is running, if it isn't, then it checks whether the autologin condition is met (whether the user is logging in from tty3 (from the linked example)), and if so, then startx.

The suggested edit to .xinitrc ensures that fluxbox is started when the command startx is issued.

cheers,

Last edited by mrclisdue; 03-13-2009 at 11:46 PM.
 
Old 03-13-2009, 11:44 PM   #12
manwithaplan
Member
 
Registered: Nov 2008
Location: ~/
Distribution: Arch || Sidux
Posts: 393

Rep: Reputation: 45
Well... it seems you got yourself a nice project... In fact if you can get it to work, share the source. I did overlook the XDM. I personally use GDM, and find it slow, and it doesn't work well with my kvm switch. Maybe a script that immediately initiates after login? Though that negates an autologin process, just an suggestion.
 
Old 03-14-2009, 12:02 AM   #13
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by mrclisdue View Post
Unless I've seriously misunderstood your intentions, the link referred to in my first post instructs you on how to get a user autolog'd-in, in runlevel3 (ie, no xdm...)
I think you understood my question correctly. The link you suggested talks about the same but looks like a very crude method and also not very flexible. Also the question was based on Debian Sarge (3.1) which is at almost 4 years old now, however most of the people who answered were using some other distros like slackware. I am pretty sure since then system start-ups must have gone through a lot of change.

If I don't find anything I will use the method in that. Although I am very doubtful it will work.

Thank you for the link though.

Last edited by kushalkoolwal; 03-14-2009 at 12:12 AM.
 
Old 03-15-2009, 05:43 AM   #14
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by manwithaplan View Post
Well... it seems you got yourself a nice project... In fact if you can get it to work, share the source.
Alright, I finally found out a very simple way to achieve the autologin without breaking my system. I even wrote a blog post regarding that.

Please let me know if there are drawbacks (I am sure every autologin method will have some) with this method. I have listed a few in the "Important Notes" section.
 
  


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 session automatically closing hattori.hanzo Linux - Newbie 7 01-12-2012 02:12 AM
Start vino-session at session start Jzarecta Linux - Software 3 04-12-2010 11:51 AM
How to start bash commands automatically every time I start the computer brgsousa Linux - Software 2 10-18-2007 12:26 PM
Eth0 not starting automatically in desktop session cbradlea Linux - Desktop 3 10-07-2007 02:15 AM
how 2 make fluxbox a session? h3xis Linux - General 6 08-21-2005 07:01 PM


All times are GMT -5. The time now is 09:42 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration