You are not logged in.

#1 2004-07-31 21:23:09

hiower4
Member
Registered: 2004-07-31
Posts: 38

automatic user login on boot..

hello everyone, this is my first post in these forums smile
just got a "new" laptop and decided to try something else than gentoo.
a rolling distro is great, but i never found compilation very entertaining...
and with an pentium 2 it doesn't get very much more optimized than -march=i686 wink

well, so over to my first question:
I really don't think i have any need to type my username and password every time i boot, i want my wm nicely up and running without my interaction after i press the power button.
Problem is that xdm doesn't seem to support this, and i don't want big parts of gnome or kde just to login...(gdm supports this function)
putting:

x:5:respawn:'/bin/su -c "/usr/X11R6/bin/startx -- -br +bs" niklas'

in /etc/inittab doesn't work either but complains about xauth etc not found.....
any ideas?

//nicke


#348498 +(4737)- [X]

<MasterG> .....................................................................
          ..................................
<judas> where's pacman when you need him?

Offline

#2 2004-07-31 21:54:31

jsutnoni
Member
Registered: 2004-02-07
Posts: 105

Re: automatic user login on boot..

http://wiki.archlinux.org/index.php/Sta … 0at%20boot

Tells ya step by step how to do jsut that smile


-=JsutNoni=-

Offline

#3 2004-07-31 22:44:18

hiower4
Member
Registered: 2004-07-31
Posts: 38

Re: automatic user login on boot..

no, that just start xdm...

thing is that i don't want to see xdm at all, but skip the login and get X anyway.
If it would be better to have it in inittab (restart on termination) or in rc.conf im not sure of... could always write an own script and add it to the deamons line. smile
there aren't any security issues with this are there? wink
from the outside i mean, internet, because this really should affect things experienced by the
mortal sitting on the chair in front of the screen......if my logic doesn't mislead me totally.....


#348498 +(4737)- [X]

<MasterG> .....................................................................
          ..................................
<judas> where's pacman when you need him?

Offline

#4 2004-07-31 23:08:54

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: automatic user login on boot..

hiower4 wrote:
x:5:respawn:'/bin/su -c "/usr/X11R6/bin/startx -- -br +bs" niklas'

in /etc/inittab doesn't work either but complains about xauth etc not found.....
any ideas?

ideas? hmm ... your PATH is not set at this state of startup to contain /usr/X11R6/bin/ where xauth is located ... that's why it is not found

i dont know for sure, but you can add at the end of rc.sysinit the declaration of the PATH variable to solve this


The impossible missions are the only ones which succeed.

Offline

#5 2004-08-01 23:23:32

potentials
Member
Registered: 2004-01-04
Posts: 130

Re: automatic user login on boot..

You can follow this guide
http://www.linuxgazette.com/issue72/chung.html

Go to the part named "The nuts-n-bolts method"

I've followed it and now I autologin just fine.

Offline

#6 2004-08-02 07:51:54

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Re: automatic user login on boot..

If this works then please put it in Wiki....even the link would help

I am fed up with KDM.... I do not want  it..... :cry:

I tried the above article... I can get to user logged in but startx does not work

which file did you edit with startx line my .bash_profile is :


. $HOME/.bashrc

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
  startx
fi

Is this correct?


Mr Green

Offline

#7 2004-08-02 11:14:39

mctavish
Member
From: Australia
Registered: 2004-03-22
Posts: 48

Re: automatic user login on boot..

Very nice. I've been wanting something like this for some time.

Mr Green, this is what I put in my .bash_profile

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/vc/1 ]; then
    startx
fi

EDIT: this is what works for me, i'm using udev.

I'd guess this will not work for devfs The code Mr Green has above might be ok I don't know.

Offline

#8 2004-08-02 11:40:34

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Re: automatic user login on boot..

Hi,

Thats works too to shell promt..... then I have to startx here is my .bash_profile :

. $HOME/.bashrc
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
  startx
fi

Does it look like yours ??

Thanks for your help


tongue


Mr Green

Offline

#9 2004-08-02 11:52:39

mctavish
Member
From: Australia
Registered: 2004-03-22
Posts: 48

Re: automatic user login on boot..

My ~/.bash_profile looks like this:

. $HOME/.bashrc
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/vc/1 ]; then
     startx
fi 

The only difference between your ~/.bash_profile file and mine is that I have substituted /dev/vc/1 for /dev/tty1

I'm guessing the /dev/vc/1 is the display device under udev, whereas /dev/tty1 is the devfs equivalent.

Anyway, I hope that helps.

Offline

#10 2004-08-02 14:48:37

hiower4
Member
Registered: 2004-07-31
Posts: 38

Re: automatic user login on boot..

this is what i have:

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/vc/1 ]; then
         startx -- -br +bs
  fi

i have devfs and it works fine for me... however, i have found that xdm can be pretty cool too if you theme it smile

try www.google.com: search: xdm theme wink


#348498 +(4737)- [X]

<MasterG> .....................................................................
          ..................................
<judas> where's pacman when you need him?

Offline

#11 2004-08-02 22:00:07

mctavish
Member
From: Australia
Registered: 2004-03-22
Posts: 48

Re: automatic user login on boot..

i have devfs and it works fine for me

So I was wrong, udev/devfs has nothing to do with it. I can take it!  smile

Offline

#12 2004-08-03 08:28:02

hiower4
Member
Registered: 2004-07-31
Posts: 38

Re: automatic user login on boot..

potentials wrote:

You can follow this guide
http://www.linuxgazette.com/issue72/chung.html

Go to the part named "The nuts-n-bolts method"

I've followed it and now I autologin just fine.

it works, Great! smile although i feel it being a little unecessary to involve c-programming, a simple:

#!/bin/bash
exec /bin/login -f niklas

works just fine for me smile

EDIT: tiny word change


#348498 +(4737)- [X]

<MasterG> .....................................................................
          ..................................
<judas> where's pacman when you need him?

Offline

#13 2004-08-03 09:27:56

hiower4
Member
Registered: 2004-07-31
Posts: 38

Re: automatic user login on boot..

i changed my inittab and .bashrc slightly,

inittab:

c8:2:once:/sbin/agetty -n -l /usr/local/bin/autologin.sh 38400 vc/8

this way it does not take my first console and it starts just once.

.bashrc:

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/vc/8 ]; then
          screen -dmS xstart startx -- -br +bs && exit
  fi

this logs in, starts screen, runs startx from it and exits.
now i have X logging if i want it without paying a console for it smile
of course, this presupposes that you have screen installed


#348498 +(4737)- [X]

<MasterG> .....................................................................
          ..................................
<judas> where's pacman when you need him?

Offline

#14 2004-08-05 10:52:42

bogomipz
Member
From: Oslo, Norway
Registered: 2003-11-23
Posts: 169

Re: automatic user login on boot..

i had the following in inittab before (about half a year ago):

x:5:once:/bin/su - username -l -c xinit

xinit could be changed to startx if you like that better  (or xinit -- -nolisten tcp).

in my .bashrc i have this:

alias x='tty | grep -q "^/dev/vc/" && exec xinit -- -nolisten tcp'

which i started using when i stoped using auto-login. then i switched to xdm, then Login.app


All of your mips are belong to us!!

Offline

Board footer

Powered by FluxBB