LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-13-2003, 03:33 PM   #1
phoeniXflame
Member
 
Registered: Feb 2003
Location: Somewhere, UK
Distribution: Slack, OpenBSD, Debian, SuSE
Posts: 189

Rep: Reputation: 30
X bootup without login


hi guys, dont suppose anyone could point me in the direction of a HOWTO or guide or something that would explain how I could boot into an X session and run a program without having to login ? (in slack 8.1) I need this because I'm building a 'set top box' for my tele using a linux backend and I want the box to bootup and go straight into the software and not prompt for a login

PS. I do realise this is horribly unsecure

Last edited by phoeniXflame; 04-13-2003 at 03:35 PM.
 
Old 04-13-2003, 03:38 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
In KDE:
System settings -> Login Screen

Set the system to automatically login a user at boot.
 
Old 04-13-2003, 03:39 PM   #3
phoeniXflame
Member
 
Registered: Feb 2003
Location: Somewhere, UK
Distribution: Slack, OpenBSD, Debian, SuSE
Posts: 189

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by david_ross
In KDE:
System settings -> Login Screen

Set the system to automatically login a user at boot.
thx for quick reply, but I dont run KDE, I run fluxbox and its loaded via startx and .xinitrc in the home dir of the user I want to boot into

I actually dont really care which window manager it is as long as its NOT KDE or Gnome as I find both of them are far to bulky to just launch 1 program, waste of resources imo

Last edited by phoeniXflame; 04-13-2003 at 03:49 PM.
 
Old 04-13-2003, 04:04 PM   #4
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
I think you need to configure xdm instead of using kdm or gdm. You need to have a user logged in to use linux, that's how it works: with users and file permissions.
 
Old 04-13-2003, 04:14 PM   #5
phoeniXflame
Member
 
Registered: Feb 2003
Location: Somewhere, UK
Distribution: Slack, OpenBSD, Debian, SuSE
Posts: 189

Original Poster
Rep: Reputation: 30
yes I realise you have to have someone logged in, I r not a total newbie I was just thinking maybe it could be done from a bootup script whereby the script su's to the user and starts his X session, therefore bypassing the need for login (seeing as bootup scripts are ran as root)
 
Old 04-13-2003, 04:17 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
That sounds like it should would work - why not just try it.
 
Old 04-13-2003, 04:20 PM   #7
phoeniXflame
Member
 
Registered: Feb 2003
Location: Somewhere, UK
Distribution: Slack, OpenBSD, Debian, SuSE
Posts: 189

Original Poster
Rep: Reputation: 30
heh good point, I'll give it a go, I'm always doing that, asking a question and THEN thinking about how I could solve it
 
Old 04-13-2003, 04:33 PM   #8
phoeniXflame
Member
 
Registered: Feb 2003
Location: Somewhere, UK
Distribution: Slack, OpenBSD, Debian, SuSE
Posts: 189

Original Poster
Rep: Reputation: 30
ok I tried it with the following code ...

Code:
#!/bin/sh
exec /bin/su username -v "/usr/X11R6/bin/startx"
but that threw up loads of errors which I'm afraid I cant write here because they dissapear too fast :| any ideas ?

Last edited by phoeniXflame; 04-13-2003 at 04:52 PM.
 
Old 04-13-2003, 04:40 PM   #9
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Erm, doesnt that try to run sh which then tries to run sh logged in as username?
Isnt there an .initrc or .xsession config file that's better to edit?
 
Old 04-13-2003, 04:50 PM   #10
phoeniXflame
Member
 
Registered: Feb 2003
Location: Somewhere, UK
Distribution: Slack, OpenBSD, Debian, SuSE
Posts: 189

Original Poster
Rep: Reputation: 30
I cannot think of any way that editing either the xinitrc or xsession will help, because they are only executed when a user starts a session, and I need to get the session started in the first place

EDIT: and yea sorry, that meant to say /bin/su not /bin/sh

I've added the script to /etc/rc.d/rc.M (which is the multiuser runlevel script for slack 8) so that it checks for and executes my rc.xbootup script, but I get the following errors ...

Code:
Starting XbootUP ...
/usr/X11R6/bin/startx: xauth: command not found
/usr/X11R6/bin/startx: xauth: command not found
/usr/X11R6/bin/startx: xauth: command not found
/usr/X11R6/bin/startx: xauth: command not found
/usr/X11R6/bin/startx: xinit: command not found
/usr/X11R6/bin/startx: xauth: command not found

Last edited by phoeniXflame; 04-13-2003 at 04:57 PM.
 
Old 04-13-2003, 05:16 PM   #11
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Well I'm guessing the xauth error is X wanting a user logged in.

Do you know how linux servers are set up so that the admin can log in remotely? Maybe you should research this a bit?
 
Old 04-13-2003, 05:21 PM   #12
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Considering it says command not found it sounds like it is saying the command is not found. ie it ain't inn the path. This is perfectly understandable as the path isn't set until a user logs in. Try setting the path varibale before you issue the command to start X.
 
Old 04-13-2003, 05:49 PM   #13
phoeniXflame
Member
 
Registered: Feb 2003
Location: Somewhere, UK
Distribution: Slack, OpenBSD, Debian, SuSE
Posts: 189

Original Poster
Rep: Reputation: 30
yea thx for that, I actually figured it out a min ago, I managed to solve the problem by adding an export command to the script to add the paths to the X binarys to the $PATH env. variable so, just for future reference if anyone else wants to do this ....

==============================================

1: create a new user and create an .xinitrc file in the home directory of that user containing the commands to launch your desired window manager and program(s)

2: create a script and place it in /sbin or whereever you want, the script should contain something similar to this ..

Code:
#!/bin/sh
echo "Starting Custom Runlevel ..."

# Add any additional commands here

exec /bin/su - youruser -c "export PATH=$PATH:/usr/X11R6/bin;/usr/X11R6/bin/startx" < /dev/tty14 > /dev/tty15"
this will add the paths to the X binarys to your $PATH env. variable and execute the startx script under your user you created earlier.

3: edit your /etc/inittab file and change the default runlevel to the custom runlevel (which you are just about to create, which in my case was "id:7:initdefault" (or whichever runlevel you have next/free) then add the line "x:7:spawn:/location/to/your/script" after the default runlevel line (change the 7 to whatever runlevel u added in your initdefault)

4: reboot and pray btw this was all done on my laptop running slackware 8.1 so I dont know whether this will apply to or work with other distros

==============================================

Last edited by phoeniXflame; 04-14-2003 at 12:52 PM.
 
Old 04-13-2003, 10:28 PM   #14
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
I don't think a graphical login can let you do it, unless you hack the commands it executes. Looking at the /etc/inittab, one can try something like I recommended in:

http://www.linuxquestions.org/questi...ght=auto+login

Since, there was no reply, I'm not sure if it works, but there should not be a problem. Only difference is that you will also want to 'startx' automatically(at the end of that script, or something similar).
 
Old 04-14-2003, 12:35 PM   #15
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Did you not read the posts?

He has already done it!
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I have a text bootup and login dpembrook Fedora 2 11-28-2004 02:32 AM
How do I bypass the console login after bootup? DeafGeek Linux - Security 4 09-20-2004 09:20 AM
Crazy blank dialog boxes and windows at login. Can't login as user soren625 Linux - General 2 08-11-2004 06:30 AM
How to convert a bootup floppy to a bootup CD ? wlaw Linux - Newbie 2 07-15-2004 03:28 AM
login screen font size over 100 - can't login xzy2435 Linux - Newbie 1 11-20-2003 11:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:31 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
Open Source Consulting | Domain Registration