LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   AutoLogin in Slack? (http://www.linuxquestions.org/questions/slackware-14/autologin-in-slack-63525/)

r_jensen11 06-03-2003 08:39 PM

AutoLogin in Slack?
 
Is it possible to have Slack 8.1 automatically log into one profile? On my system, I have the root account, then my personal account, no other ones because I have no need for any additional accounts. Also, is it possible to have Slack automatically issue the command startx after it logs in? If so, could it be possible to have a boot setup such as in LILO to have two options, one, the first and default, to have it automaticaly log into the account and then start X, and the second option have it as a normal Slack8.1 login screen and not boot into X, so I could do stuff such as load a different window manager, such as Flux or BlackBox, or KDE?

DaOne 06-03-2003 08:52 PM

You can change the runlevel to 4 by editing /etc/inittab, line 24...
#Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:


This will use a graphical login instead of the console. If you use KDE, you can use the KDM login manager (you may need to edit /etc/rc.d/rc.4 and make the kdm login manager the first choice instead of gdm), and then in KDE Control Center, setup your user to use an automatic or passwordless login.

EDIT:
Here is an example of the first few entries in my rc.4 script...

# Tell the viewers what's going to happen...
echo "Starting up X11 session manager..."

# Try to use KDE's kdm session manager:
if [ -x /opt/kde/bin/kdm ]; then
exec /opt/kde/bin/kdm -nodaemon
fi

# Try to use GNOME's gdm session manager:
if [ -x /usr/bin/gdm ]; then
exec /usr/bin/gdm -nodaemon
fi

# Not there? OK, try to use KDE's kdm session manager:
#if [ -x /opt/kde/bin/kdm ]; then
# exec /opt/kde/bin/kdm -nodaemon
#fi

Tinkster 06-03-2003 08:57 PM

Quote:

Is it possible to have Slack 8.1 automatically log into one profile?
Yes ... both kdm and gdm support this.

Quote:

Also, is it possible to have Slack automatically issue the command startx after it logs in?
Yes ... two ways (at least ;}):
1.) Edit /etc/inittab and set the default runlevel to 4

2.) Edit /etc/rc.d/rc.local and add /opt/kde/bin/kdm&
as the last line...

Quote:

If so, could it be possible to have a boot setup such as in LILO to have two options, one, the first and default, to have it automaticaly log into the account and then start X, and the second option have it as a normal Slack8.1 login screen and not boot into X, so I could do stuff such as load a different window manager, such as Flux or BlackBox, or KDE?
And yes, again ;)

There's a bunch of options here, you could use
some of the packages that are available online
(search freshmeat) to have configuration choices,
or a "do it yourself" approach ... which is what I did
for my notebooks varied setup.

Lilo allows you to set environment variables, and
you can query these from your startup-script(s)
which allows for a very versatile setup...

Code:

snippet from lilo.conf
# Linux bootable partition config begins
image = /boot/vmlinuz.rc2
  root = /dev/hda8
  label = work
        append="LOCATION=work"
  read-only
# Linux bootable partition config ends

Code:

snippet from rc.inet1
if [ "$LOCATION" = "work" ]; then
    USE_DHCP=yes
    # If your provider requires a DHCP hostname, uncomment and edit below:
    DHCP_HOSTNAME="tink-n"
    /bin/cp /etc/resolv.conf.work /etc/resolv.conf
    /bin/cp /etc/hosts.work /etc/hosts
else
    USE_DHCP=no
    /bin/cp /etc/resolv.conf.home /etc/resolv.conf
    /bin/cp /etc/hosts.home /etc/hosts
    # If your provider requires a DHCP hostname, uncomment and edit below:
fi

Just to give you a general idea :}
You could put a similar statement into rc.local,
depending on which you'd start kdm (and thus
auto-login into your normal user's X) or not...

Cheers,
Tink

r_jensen11 06-03-2003 09:59 PM

Tinkster, which way(s) would you recommend I go about doing this if I want to have a boot choice between automatically in Gnome or the shell login and remaining in text mode?

Tinkster 06-04-2003 03:13 PM

Well, what I would do is what I did :)

I'm sure there's better ways out there, but in brief:

1.) Put two entires into /etc/lilo.conf
that point at the same kernel, but give them
different names, like
Code:

# Linux bootable partition config begins
image = /boot/vmlinuz.rc2
  root = /dev/hda8
  label = choice
  read-only
# Linux bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz.rc2
  root = /dev/hda8
  label = Gnome
        append="XENV=gnome"
  read-only
# Linux bootable partition config ends

2.)In /etc/rc.d/rc.local
Code:

if [ "$XENV" = "gnome" ]; then
  /opt/kde/bin/kdm&
fi

3.) All you'd have to do now is to go into kde once
and set-up your normal user in the KDM
settings of the control panel to have auto-login,
and chose gnome as the default desktop.

If you haven't got KDE/kdm, it should be possible
with gdm, too, but I can't give you any pointers
since I don't use it.

Cheers,
Tink


All times are GMT -5. The time now is 01:52 AM.