Need to launch app automatic after autologin completes

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need to launch app automatic after autologin completes

665 Views
sreedhar_appala
Contributor IV

Hi,

I am able to do autologin as suggested by victor in earlier thread.

Auto login and execute the custom script on bootup on iMX8M Mini 

My requirement is to launch the application after the auto-login succeed and i tried writing myscript.sh placing the commands in it.

i have placed the myscript.sh in the /etc/init.d/ location.

after that changed the permissions using chmod a+x.

executed : sudo update-rc.d myscript.sh defaults

and rebooted the target.

But my application did not launch.

#2) When i tried to  execute the aplication in the /etc/rc.local

     it is preventing the autologin and stuck saying a job is running ......and stuck there.

 

Could you please suggest, how i can launch my app after everything is fine including auto-login.

thank you, sreedhar

0 Kudos
3 Replies

515 Views
b36401
NXP Employee
NXP Employee

1)
Please note that /etc/init.d/ direcroty only contains system start and stop scripts.
The sequences of running are placed into /etc/rcX.d/ directoies where X is a digit from 0 to 6 means exact runlevel.
So after placing the script into /etc/init.d/ you need to create a symlink to it from /etc/rc3.d/ or /etc/rc5.d/.
You can know current runlevel with "runlevel" command.

2)
You need to run your aplication in background not foreground.

0 Kudos

515 Views
sreedhar_appala
Contributor IV

Hi Victor Linnik,

Thank you.

Actually my user application is interactive one, i need my app launch automatically after auto login.

if i run the application in background, i can't issue the inputs through tty console.

Could you please suggest any alternate method or possibly an example reference.

thank you, sreedhar

0 Kudos

515 Views
b36401
NXP Employee
NXP Employee

Do you need it to be as interactive as login shell you are getting by default?
You can add it to startup of root (or other user you use for auto-login).
I mean you can add it into /home/root/.profile file.

0 Kudos