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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-28-2003, 01:13 PM
|
#1
|
LQ Newbie
Registered: Jul 2003
Location: Bellevue, WA
Distribution: RedHat
Posts: 10
Rep:
|
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
|
|
|
08-28-2003, 02:37 PM
|
#2
|
Member
Registered: Aug 2003
Location: Arizona
Distribution: Gentoo
Posts: 142
Rep:
|
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?
|
|
|
08-28-2003, 03:33 PM
|
#3
|
LQ Newbie
Registered: Jul 2003
Location: Bellevue, WA
Distribution: RedHat
Posts: 10
Original Poster
Rep:
|
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.
|
|
|
08-28-2003, 11:49 PM
|
#4
|
Member
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720
Rep:
|
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.
|
|
|
08-28-2003, 11:58 PM
|
#5
|
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313
Rep:
|
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.
|
|
|
08-29-2003, 12:41 AM
|
#6
|
LQ Newbie
Registered: Jul 2003
Location: Bellevue, WA
Distribution: RedHat
Posts: 10
Original Poster
Rep:
|
Sorry, none of this has anything to with KDE. There is no desktop involved, strictly X via startx.
New suggestions?
|
|
|
08-29-2003, 05:43 AM
|
#7
|
Member
Registered: Jul 2003
Location: London
Posts: 548
Rep:
|
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...]
|
|
|
08-29-2003, 07:05 AM
|
#8
|
Member
Registered: May 2003
Distribution: Slackware 9.1
Posts: 85
Rep:
|
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.
|
|
|
08-29-2003, 08:17 AM
|
#9
|
Member
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512
Rep:
|
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.
|
|
|
08-29-2003, 05:02 PM
|
#10
|
LQ Newbie
Registered: Jul 2003
Location: Bellevue, WA
Distribution: RedHat
Posts: 10
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 12:36 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|