How can I run a script or an application automaticaly once the linux boot has finished?

Hi,

I want to autorun a python script as root just when the yocto boot finishes.

I have tried to put the script on the /etc/init.d file and then use the command:
->update-rc.d script.py defaults 99

but when I restart the board it appears the following error:

/etc/init.d/rc: line 56: /etc/rc5.d/S99script.py: Permission denied

Do you know how to solve this or any other way to autorun a script on startup?

Thank you in advance

/etc/rc5.d/S99script should be a shell script that calls your python script. you cannot call python code directly from there

1 Like

I have tried that and works. But the problem is that the scripts are executed before finishing the autologin and the booting and I want to execute it after that.

Any ideas of how to do it?

then you call it from one of the user’s startup files, like .login or .profile
https://gerardnico.com/lang/bash/login_logout_script

https://stackoverflow.com/questions/26052034/can-you-run-a-script-every-time-bin-sh-is-invoked