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


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 defaults 99

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

/etc/init.d/rc: line 56: /etc/rc5.d/ 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