Giandroid
Posts: 16
Joined: Mon Dec 08, 2014 5:36 am

Auto login + auto start application in Raspian Jessie Lite [obsolete now multiple OS generations old]

Sat Feb 11, 2017 11:13 am

Hello! A few years back I made a pi powered word processor that ran Raspian Jessie, with a gui desktop and everything (I changed from the default LXDE to Mate because I liked it better, but that's besides the point).

Well now I'm prototyping a new word processor powered by the PI Zero with no GUI. I'm going with Jessie Lite. Instead of Libre Office (obviously) I'm running Word Grinder.

Here's my issue. I need the OS to (A) automatically log in and (B) automatically start up WordGrinder. This is so the user never has to manually type in Word Grinder to start up the app. In a perfect world they wouldn't even know they're in Linux at all.

I am using this guide to automatically start up Word Grinder and this guide to automatically log into the pi user.

The trouble is, I'm able to automatically log in but not to automatically start up word grinder.

I can tell during the verbose boot sequence that the init.d script I wrote to start up Word Grinder does indeed run. I tested the script and it works. But when it boots, Word Grinder just plum doesn't load up. The script apparently loaded fine but all I see is an input prompt waiting for a command.

I also tried adding word grinder to rc.local but that causes all kinds of glitchy issues. Word grinder at least starts at boot but before the rest of the boot finishes, and I get all kinds of problems.

Any help is much appreciated! I'd love to get this up and running sooner rather than later.

wh7qq
Posts: 1343
Joined: Thu Oct 09, 2014 2:50 am

Re: Auto login + auto start application in Raspian Jessie Li

Sun Feb 12, 2017 12:12 am

The "Boot Options" selection in "raspi-config" gives you the choice of booting with or without password in either Pixel or the CLI. you can also bypass the splash screen.

I have not tried it yet but what I have read indicates that you should put your command in /etc/rc.local, taking care to preserve the "exit 0" at the end of the file.

Giandroid
Posts: 16
Joined: Mon Dec 08, 2014 5:36 am

Re: Auto login + auto start application in Raspian Jessie Li

Sun Feb 12, 2017 2:14 am

I am not on full Jessie, I have Jessie Lite, which is command line only. So I can't use raspi-config to auto login.
I was able to auto login using this code:

Code: Select all

sudo -i
mkdir -pv /etc/systemd/system/getty@tty1.service.d
nano /etc/systemd/system/getty@tty1.service.d/autologin.conf
Then in the new service I created I wrote:

Code: Select all

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi --noclear %I 38400 linux
This gets me automatically logged in. However, when I tried editing the rc.local file to run wordgrinder, an interesting thing happens. Wordgrinder does start up, but I can't use it. No keystrokes write anything:

Image
Not only can't I write in it, but when I hit the arrow keys I seem to scroll into a new session that's totally blank, with which I cannot interact. Here's a photo of what that looks like:

Image

So... I'm close. This at least gets me to start word grinder, even if I don't use it. My init.d script, on the other hand, doesn't seem to work at all.

I would love to grab some logs for you, but I do not know which logs I should grab or how to get them..

Thanks for the reply!
Last edited by Giandroid on Sun Feb 12, 2017 2:23 am, edited 1 time in total.

Giandroid
Posts: 16
Joined: Mon Dec 08, 2014 5:36 am

Re: Auto login + auto start application in Raspian Jessie Li

Sun Feb 12, 2017 2:37 am

After switching back and forth between a few sessions, I eventually came to this. It looks like the command line (or syslog) is running INSIDE word grinder. It's giving me reports about scripts starting and stopping but it is not letting me use wordgrinder itself. Here's a screen shot:

Image

Isn't that funky? I'd sure like to know what's going on here.

Giandroid
Posts: 16
Joined: Mon Dec 08, 2014 5:36 am

Re: Auto login + auto start application in Raspian Jessie Li

Sun Feb 12, 2017 7:31 am

wh7qq wrote:The "Boot Options" selection in "raspi-config" gives you the choice of booting with or without password in either Pixel or the CLI.
Oh snap- I missed this crucial part of the post. The raspi-config does indeed allow auto login with command line.

I deleted the previous service I made for this purpose and enabled auto login through raspi-config.

Same problem though. No WordGrinder.

Ernst
Posts: 1248
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Auto login + auto start application in Raspian Jessie Li

Sun Feb 12, 2017 9:33 am

Giandroid wrote:Hello! A few years back I made a pi powered word processor that ran Raspian Jessie, with a gui desktop and everything (I changed from the default LXDE to Mate because I liked it better, but that's besides the point).

Well now I'm prototyping a new word processor powered by the PI Zero with no GUI. I'm going with Jessie Lite. Instead of Libre Office (obviously) I'm running Word Grinder.

Here's my issue. I need the OS to (A) automatically log in and (B) automatically start up WordGrinder. This is so the user never has to manually type in Word Grinder to start up the app. In a perfect world they wouldn't even know they're in Linux at all.

I am using this guide to automatically start up Word Grinder and this guide to automatically log into the pi user.

The trouble is, I'm able to automatically log in but not to automatically start up word grinder.

I can tell during the verbose boot sequence that the init.d script I wrote to start up Word Grinder does indeed run. I tested the script and it works. But when it boots, Word Grinder just plum doesn't load up. The script apparently loaded fine but all I see is an input prompt waiting for a command.

I also tried adding word grinder to rc.local but that causes all kinds of glitchy issues. Word grinder at least starts at boot but before the rest of the boot finishes, and I get all kinds of problems.

Any help is much appreciated! I'd love to get this up and running sooner rather than later.
I do not completely understand what you are trying to do because there are some important points missing, like what should happen after closing the editor and how to access the system for maintenance.

I have a very simple solution that works with very little effort. The first thing to do is to install the OS and make it login automatically to the CLI, set your keyboard configuration, install wordgrinder. Then boot into the CLI and make sure that everything works as expected before making the next change.

Now enter the following command on the console:

Code: Select all

 sed -i "1 i if [ \`tty\` == '/dev/tty1' ]; then wordgrinder;sudo halt; fi"  .bashrc
From this point a reboot will automatically start wordgrinder and the system will be halted when you exit wordgrinder.

For maintenance you can use ssh or the CLI by pressing Alt-F2 when wordgrinder is loaded.
The road to insanity is paved with static ip addresses

Giandroid
Posts: 16
Joined: Mon Dec 08, 2014 5:36 am

Re: Auto login + auto start application in Raspian Jessie Li

Sun Feb 12, 2017 9:53 am

Thank you! I will try this. Reimiging my SD card now...

Giandroid
Posts: 16
Joined: Mon Dec 08, 2014 5:36 am

Re: Auto login + auto start application in Raspian Jessie Li

Sun Feb 12, 2017 11:08 am

Ernst wrote:
Giandroid wrote:Hello! A few years back I made a pi powered word processor that ran Raspian Jessie, with a gui desktop and everything (I changed from the default LXDE to Mate because I liked it better, but that's besides the point).

Well now I'm prototyping a new word processor powered by the PI Zero with no GUI. I'm going with Jessie Lite. Instead of Libre Office (obviously) I'm running Word Grinder.

Here's my issue. I need the OS to (A) automatically log in and (B) automatically start up WordGrinder. This is so the user never has to manually type in Word Grinder to start up the app. In a perfect world they wouldn't even know they're in Linux at all.

I am using this guide to automatically start up Word Grinder and this guide to automatically log into the pi user.

The trouble is, I'm able to automatically log in but not to automatically start up word grinder.

I can tell during the verbose boot sequence that the init.d script I wrote to start up Word Grinder does indeed run. I tested the script and it works. But when it boots, Word Grinder just plum doesn't load up. The script apparently loaded fine but all I see is an input prompt waiting for a command.

I also tried adding word grinder to rc.local but that causes all kinds of glitchy issues. Word grinder at least starts at boot but before the rest of the boot finishes, and I get all kinds of problems.

Any help is much appreciated! I'd love to get this up and running sooner rather than later.
I do not completely understand what you are trying to do because there are some important points missing, like what should happen after closing the editor and how to access the system for maintenance.

I have a very simple solution that works with very little effort. The first thing to do is to install the OS and make it login automatically to the CLI, set your keyboard configuration, install wordgrinder. Then boot into the CLI and make sure that everything works as expected before making the next change.

Now enter the following command on the console:

Code: Select all

 sed -i "1 i if [ \`tty\` == '/dev/tty1' ]; then wordgrinder;sudo halt; fi"  .bashrc
From this point a reboot will automatically start wordgrinder and the system will be halted when you exit wordgrinder.

For maintenance you can use ssh or the CLI by pressing Alt-F2 when wordgrinder is loaded.
My friend, you are a genius! This worked. It even automatically halts after exiting word grinder- this is exactly what I was looking for!

I am now going to teach myself everything about those commands so I can figure out exactly how you did it.

I can't thank you enough!

wh7qq
Posts: 1343
Joined: Thu Oct 09, 2014 2:50 am

Re: Auto login + auto start application in Raspian Jessie Li

Mon Feb 13, 2017 10:20 pm

I just noticed this in one of the early posts on this thread:
am not on full Jessie, I have Jessie Lite, which is command line only. So I can't use raspi-config to auto login.
I was able to auto login using this code:
It has been a while since I last messed with Lite but raspi-config is a CLI utility. It requires root privileges so the command is

Code: Select all

sudo raspi-config
. If the Lite devs excluded raspi-config, all you need to do is

Code: Select all

sudo apt-get update && sudo apt-get install raspi-config
It has an ncurses text interface that is easier to use than going into the various config files and editing them.

Return to “Troubleshooting”