LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 09-01-2008, 05:01 PM   #1
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Rep: Reputation: 15
Help newbie use Linux to make a Digital Picture Frame


I have an old laptop, that I installed in a picture frame. It needs to boot, login, and run a slideshow of pictures from a flash drive, with no user intervention. The program 'feh' works perfect for this because of it's excellent command line options.

It has only a 1GB CF card for a flash drive. I gave up on using DSL and installed a command-line Hardy Heron system. I didn't do any stripping down after installing a command line system, then I basically just apt-get'd xorg and feh. Feh runs fine without a window manager.

The problems I have now are that I need it to auto-log me in, start x, and then run the slideshow, because I won't have a keyboard or mouse.

1. So I need to auto-login. I did a bit of searching but didn't find much.

2. I also need to place my 'startx' command somewhere, I'm not sure where.

3. And then, I need a permanent path for my 'start feh and play pictures' script, but I also need it to be on a flashdrive. So I think I might have to like add a 'mount flashdrive on boot' script in there somewhere, or put it in the fstab or something. I'm not sure if I'll be able to remove and reinstall the flashdrive (with updated pictures) with the system up and running, but I would like to.

Apparently a commandline Hardy install and X fit on a 1GB flashdrive, but how can I check my free space? I'm used to like, using konqueror or system monitor or something.
 
Old 09-01-2008, 06:37 PM   #2
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Okay, let's tackle your issues one by one (btw, the whole setup can be achieved in different ways - no guarantee this is the best)

How to autologin on console (NOTE: THIS IS MY WAY - THERE ARE OTHER WAYS (BETTER?) AND IT'S LOCALLY INSECURE)

Create an empty file in /bin (or somewhere else):

sudo touch /bin/autologin

Open it with an editor i.e.:

sudo vim /bin/autologin

and put this in:

#! /bin/bash
exec login -f <your_username_here>

Save it and make it executable:

chmod a+x /bin/autologin


Open /etc/event.d/tty<whatever_tty_you_want_to_use>:

sudo vim /etc/event.d/tty2

Change the line:

respawn
exec /sbin/getty 38400 tty2

to:

respawn
exec /sbin/getty -l /bin/autologin -n 38400 tty2

Once you rebooted you should be automatically logged in on tty2.

Report success and we'll try to achieve the rest.

Last edited by klearview; 09-01-2008 at 07:06 PM. Reason: added instruction to make file executable
 
Old 09-01-2008, 09:20 PM   #3
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
Ok I will. The process is tedious because I have to transfer this keyboard and mouse to the picture frame and then back. I'll try it soon.
 
Old 09-01-2008, 09:39 PM   #4
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
It failed.

when I rebooted it says

Ubuntu 8.04 frame tty1

frame login: _

Is this because it says frame tty1, when I used tty2 in the /bin/autologin?

/bin/autologin has full permissions.

EDIT:
I realized that I can switch to tty2 by hitting ctrl+alt+f2. So I did. It does NOT display the frame login: _ prompt, but I also can't do anything. I can type whatever I want but nothing happens, it's not really a command prompt. Hitting ctrl+alt+Fn where n=1-6 takes me to a frame login: prompt except for tty2, which is kinda blank.

I'm confused. This might mean it worked, but I expected it to log me in and return to a command prompt.

Last edited by Daravon; 09-01-2008 at 09:58 PM.
 
Old 09-01-2008, 09:59 PM   #5
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Make sure you understand the instructions before you use them. "when I used tty2 in the /bin/autologin" - how did you use tty2 in that file? It does not specify tty at all - only in /etc/event.d you choose what tty you want to be logged in automatically so if you choose tty2 you obviously are not going to be auto logged in on tty1!
 
Old 09-01-2008, 10:11 PM   #6
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by klearview View Post
Make sure you understand the instructions before you use them. "when I used tty2 in the /bin/autologin" - how did you use tty2 in that file? It does not specify tty at all - only in /etc/event.d you choose what tty you want to be logged in automatically so if you choose tty2 you obviously are not going to be auto logged in on tty1!
Yes I do understand that. Sorry if I wasn't clear. What I meant was, I chose to be auto-logged into tty2 just like the instructions. I carried out the instructions exactly and tty2 no longer displays the login prompt, and all the rest of the tty's do. But I can't do anything with tty2, it's just like a blank screen I can type things into to no effect. This might mean it worked or it might not.
 
Old 09-01-2008, 10:23 PM   #7
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
It didn't work - when everything is done correctly you will be logged in and seeing command prompt as normal. Check for mistakes.

You've modified 2 files: /bin/autologin should look like this:

Code:
#! /bin/bash
exec login -f daravon
(where daravon is the user name)
AND be executable;


And /etc/event.d/tty2 should look like this:

Code:
# tty2 - getty
#
# This service maintains a getty on tty2 from the point the system is
# started until it is shut down again.

start on runlevel 2
start on runlevel 3

stop on runlevel 0
stop on runlevel 1
stop on runlevel 4
stop on runlevel 5
stop on runlevel 6

respawn
exec /sbin/getty -l /bin/autologin -n 38400 tty2
 
Old 09-01-2008, 11:12 PM   #8
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
ok I checked them and see no mistakes. /bin/autologin is -rwxrwxrwx.

the username on the system is chaz. I used chaz in the autologin file. I don't need a password anywhere?
 
Old 09-01-2008, 11:49 PM   #9
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
No you don't need password anywhere. The user 'chaz' must already exist on the system - i.e. before you all the above the user 'chaz' must have already existed on the system. If not you need to add him.

Having said that could you post the output from your /var/log/auth.log file. The best way to do it is to run:
cat /var/log/auth.log | grep 'tty2'

and post it here.

I'm slightly worried if you followed everything correctly. For example, I don't understand how your /bin/autologin ended up chmoded to 777 (not that it matters - it still should work but ...)
 
Old 09-02-2008, 12:06 AM   #10
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
Like every ten seconds it says "can't exec /bin/autologin, Exec format error"

the /bin/autologin file seriously says
Code:
exec login -f chaz
chaz exists, that's what I log in with normally.

I chmodd'd it to 777 myself, to make sure it wasn't a permissions thing at all.

Last edited by Daravon; 09-02-2008 at 12:10 AM.
 
Old 09-02-2008, 12:20 AM   #11
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Where is '#! /bin/bash' in the first line ?????!!!!!
 
Old 09-02-2008, 12:25 AM   #12
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
Of course the #! /bin/bash line is there, sorry. It doesn't say exec login -f chaz in its entirety. I only posted the exec line because the /var/log/auth.log was complaining about exec format error.


to be explicit

Code:
#! /bin/bash

exec login -f chaz
I don't want to waste your time here. This is what I've done:

Created file /bin/autologin, containing
Code:
#! /bin/bash

exec login -f chaz
exactly as in post7.

I chmod 777'd it.

essentially, added the text

Code:
-l /bin/autologin -n
to /etc/event.d/tty2 so that it is now exactly like in post 7.

upon reboot this results in the blinking cursor screen on tty2 instead of the login prompt.

So i grepped from /var as per your instructions and got "can't exec /bin/autologin, Exec format error".

Last edited by Daravon; 09-02-2008 at 12:43 AM.
 
Old 09-02-2008, 12:51 AM   #13
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Well, at least we pinpointed a problem - albeit a strange one.

See if you can reproduce the problem. Log in as a normal user and create a file named, say, 'try'. Type in the contents of /bin/autologin (don't copy/paste just in case), make it executable and then (AS ROOT) try to execute it: ./try

If it works the output will look as if you just logged in. If the same error comes up then something in the environment of your system isn't right.

(By the way - these instructions are exactly how my Ubuntu Hardy is set up for autologin. Everything works as expected so I'm not advising you on something I haven't done myself.)

Last edited by klearview; 09-02-2008 at 12:56 AM. Reason: Clarification - last sentence (in brackets) added.
 
Old 09-02-2008, 01:02 AM   #14
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
It worked. I created 'try' in home and ran ./try

Ubuntu comes with ABSOLUTELY NO WARRANTY, etc. came up.

I just less'd try and /bin/autologin back to back; they are identical.


EDIT: as a matter of fact they are not identical. /bin/autologin has a superfluous carriage return before #! /bin/bash. I have a feeling this is a problem; I did not see this before running less and noting the extra space.

EDIT: it works now, tty2 was logged in upon reboot. It was a sneaky extra blank line at the beginning of /bin/autologin. I'm sorry for wasting your time.

Last edited by Daravon; 09-02-2008 at 01:08 AM.
 
Old 09-02-2008, 01:09 AM   #15
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
In this case everything should work. Now do this. Delete the first file:

(as root)

rm /bin/autologin

Move /path/to/try to /bin:

(as root)

mv /path/to/try /bin/autologin
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital Picture Frame as Auxiliary Status Display? bt101 Linux - Hardware 1 04-02-2008 09:38 AM
Damn Small Linux on Digital Picture Frame tjk176 Linux - Newbie 2 08-09-2007 01:01 PM
Junk notebook --> digital picture frame help! viewsonix Linux - Newbie 1 07-14-2007 01:15 AM
Linux Digital Picture Frame Project (nOOb's attempt) drdiesel Red Hat 1 05-16-2007 09:25 PM
Digital Picture Frame advice needed Heathicus Linux - Software 6 05-18-2006 04:13 AM


All times are GMT -5. The time now is 06:45 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration