Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: normad on October 06, 2012, 06:00:20 AM

Title: Skipping bash login
Post by: normad on October 06, 2012, 06:00:20 AM
hey guys im using the Olinuxino board for an embedded application. I have two compiled programs which are executed in order through a shell script. but everytime the board is reset i have to manually login before executing the shell script. Is there any way i can execute this script automatically on startup without having to manually login? because it is  impractical to connect the uart evertime on power up to login.
thanks in advance
Title: Re: Skipping bash login
Post by: jeroends on October 06, 2012, 08:35:55 AM
simply make a startup script for your app's, you can find one in the package of my modi2c: http://leachy.homeip.net/olinuxino/files/modi2c.tgz (http://leachy.homeip.net/olinuxino/files/modi2c.tgz). It's not the best script but it will get you started. Change the script to your needs and place it in /etc/init.d/ .
Title: Re: Skipping bash login
Post by: flavigny on October 06, 2012, 12:22:02 PM
Hello here is how I pass this step.

I use an Sdcard published by octavio (http://download.ossystems.com.br/images/imx233-olinuxino/ )

the sandbox is the folder /etc/init.d; it contains the tasks executed while boot, before login.

1) I put my script in /etc/init.d folder, eg:  myjob

2) in the folder /etc/rc5.d we have a lot of links. This folder is used when switching "run level" 5. Those with initial letter "S" will be run at START-TIME. so I add a symbolic link named "S55mytask" targetting my new script in /etc/init.d:
ln -s ../init.d/myjob S55mytask

as example, on the original SdCard from Olimex, watch:  rc5.d/S99led_blinking linking to: /home/root/test/led_blink &

regards.
PO.
Title: Re: Skipping bash login
Post by: Kean on October 06, 2012, 05:08:12 PM
Depends which Linux distribution you are running, whether or not you will have initscripts functionality.

I normally just add a couple of lines to /etc/rc.local like:
cd /application/folder
nohup ./appname &


Kean
Title: Re: Skipping bash login
Post by: normad on October 07, 2012, 10:56:58 AM
ok thanks a lot guys :) im using arch linux.
Title: Re: Skipping bash login
Post by: sehnpaa on October 07, 2012, 07:01:17 PM
If autologin is an option, have a look here: https://wiki.archlinux.org/index.php/Automatic_login_to_virtual_console