LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-28-2003, 01:13 PM   #1
unixgeek
LQ Newbie
 
Registered: Jul 2003
Location: Bellevue, WA
Distribution: RedHat
Posts: 10

Rep: Reputation: 0
Question Autologin to X as a user - how do I?


I've got a RedHat 9 system I'm setting up and I need to be able to autologin as a user (got that part figured out), come up in X, and start an application. If that application is exited from, I need it restarted.

How do I set this up? Should be easy for someone who's done it, and I'm sure it'll be easy once I see a solution, but I'm drawing a blank. Just one of those days, you know?

Thanks for any help you can provide.
Ron
 
Old 08-28-2003, 02:37 PM   #2
Khabi
Member
 
Registered: Aug 2003
Location: Arizona
Distribution: Gentoo
Posts: 142

Rep: Reputation: 15
hmmm.. lemme see if I have this right before I try to give you some advice. You already have have it login and startx? Or just login, but no xserver? then You'll need it to start a program and if it dies restart it?
 
Old 08-28-2003, 03:33 PM   #3
unixgeek
LQ Newbie
 
Registered: Jul 2003
Location: Bellevue, WA
Distribution: RedHat
Posts: 10

Original Poster
Rep: Reputation: 0
I've got the autologin to a shell prompt. I can also autologin and get startx started, automatically.

Its getting the program launched and stayed launched I'm having a problem with.
 
Old 08-28-2003, 11:49 PM   #4
teval
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720

Rep: Reputation: 30
You're putting this all in a file?
Which also contains startkde
make sure it's
exec startkde
And that the other apps don't have the exec in front, and have a & behind them.
All that means is that they are normally detached from the console, but in this case, it means you can kill them without bringing everything to a grinding halt.
 
Old 08-28-2003, 11:58 PM   #5
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Me I'd put kdm in rcX.d (whatever your init level is, using sysV-init editor) Set kdm to autologin whatever user (under Setting ControlCentre System Admin, Login Manager). Then in the ~/.kde/Autostart directory put a script to launch whatever programs I needed.

I've got a script called startups, that looks like this:

Code:
#!/bin/sh

#Altering keymap for Extra Keys, and to resort mouse buttons
xmodmap ~/.Xmodmap

#Extra Mouse Buttons
imwheel -k -b "67"

#Karamba eyecandy
karamba ~/.karamba/time.theme ~/.karamba/noatun.theme
All these things start, and stay until I logout.

Last edited by leonscape; 08-28-2003 at 11:59 PM.
 
Old 08-29-2003, 12:41 AM   #6
unixgeek
LQ Newbie
 
Registered: Jul 2003
Location: Bellevue, WA
Distribution: RedHat
Posts: 10

Original Poster
Rep: Reputation: 0
Sorry, none of this has anything to with KDE. There is no desktop involved, strictly X via startx.

New suggestions?
 
Old 08-29-2003, 05:43 AM   #7
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 31
okay, I'm not sure if I'm understanding your questions correctly, but here's my $0.02:
you could edit your .bashrc so that when you log in on a console, it runs:
#!/bin/bash
startx&
mozilla&

That should take care of starting the program when you log in. As for restarting when the application closes [I presume you mean the computer], you could edit the .bashrc script to say:
mozilla && sudo /sbin/reboot.
This means that when it finishes executing the mozilla command, it will move onto the next [I'm not sure if this would actually work, as I haven't tried it, but I'm fairly certain that it would...]
 
Old 08-29-2003, 07:05 AM   #8
mondaypickle
Member
 
Registered: May 2003
Distribution: Slackware 9.1
Posts: 85

Rep: Reputation: 15
to start the application, add it to ~/.xinitrc, if that doesnt exist, /etc/X11/xinit/xinitrc. but as was said before add a & after it. on makeing it restart when its closed, i dont reallly know, u could make a cron script that would check if it was running, but this isnt really a good way. i dunno if its possible but u could try a script that does something like "mozilla && <the script again>" this is assuming u ment for the program to restart not the computer.
 
Old 08-29-2003, 08:17 AM   #9
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
Re: Autologin to X as a user - how do I?

Quote:
Originally posted by unixgeek
I've got a RedHat 9 system I'm setting up and I need to be able to autologin as a user (got that part figured out), come up in X, and start an application. If that application is exited from, I need it restarted.

How do I set this up? Should be easy for someone who's done it, and I'm sure it'll be easy once I see a solution, but I'm drawing a blank. Just one of those days, you know?

Thanks for any help you can provide.
Ron
put a respawn in /etc/inittab. and put in your .xinitrc the name of the app that you want to start.
 
Old 08-29-2003, 05:02 PM   #10
unixgeek
LQ Newbie
 
Registered: Jul 2003
Location: Bellevue, WA
Distribution: RedHat
Posts: 10

Original Poster
Rep: Reputation: 0
Talking

Got it, finally.

When the user gets auto-logged in, .bash_profile gets read. In it, I simply have:

xinit appname
logout


When the app is exited, the user is logged out, but gets autologged back in and starts the process over.

I originally was using startx instead of xinit. Took awhile to figure THAT out. Thanks for the help and suggestions.
 
  


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
Set autologin with default user on Red Hat Enterprise 3 dmanchepalli Linux - General 6 02-02-2005 12:08 PM
Set autologin with default user on Red Hat Enterprise 3 dmanchepalli Red Hat 1 02-01-2005 04:01 PM
autologin zaicheke Linux - General 1 07-16-2004 07:15 PM
Two Questions: autologin to X, and setting the adding a user to a group. Cobra133 Slackware 8 06-01-2004 02:43 PM
Autologin or "Default User" with RH7.0 uncmonky Linux - General 0 03-21-2001 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:36 AM.

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