How Can I boot my application at boot

I’m trying to boot my application at power on, but failed, please help me to boot self developped application at power on.

BTW, I have tried following steps.

create sh file under /etc/init.d/Apillar, and under /etc/rc5.d, I create symbol link for /etc/init.d/Apillar
But After reboot, Apillar hasn’t been start.(my app just show capture from uvc camera using imshow)

my sh file 's content:

#! /bin/sh

start(){
cheo “Starting Apillar”
cd /usr/bin
./APILLAR
}
stop(){
killall APILLAR
echo “Stopped”
}

You could try to put the script under /etc/profile.d.

I checked from the /var/log/syslog, it shows “Starting Apillar.service”, but my graphic Application didn’t pop up,
Is it because Apillar.service starts before “Starting Login Service…”? or because my application is acturally not a real service(I need to register them as service first? how?)

BTW:
readelf -h APILLAR

ELF Header
Magic: 7f 45 4c 46 02 01 01 03 00 00 00 00 00 00 00 00
class: ELF64
Data: 2’s complement,little endian
Version: 1(current)
OS/ABI: UNIX-GNU
ABI VERSION: 0
Type: DYN(shared object file)
Machine: AArch64
Version: 0x1

The topic is rather large, but what you will probably need to do is suffer the learning curve for “systemd”. “systemd” is replacing older style init scripts. Basically you’d create a service for your program that way, and then create some dependencies, such as needing X GUI to start. Considering your situation you might need X to auto login some particular user, and then make a dependency on that user logging in as well.

Note: Sometimes it is simpler to just put this into the login scripts of an individual user. Then the script runs upon GUI login. If the GUI auto logs in this user, then it works out and is simpler than systemd. You may have security issues though.

Thanks very mush for your reply, but I know little about systemd, would you please tell me much more precisely how I can create service with systemd, and how to do " X to auto login some particular user, and then make a dependency on that user logging in as well", thank you very mush

Some reference for systemd
https://wiki.ubuntu.com/SystemdForUpstartUsers

As a starting point, realize that almost all file edits you might make for a systemd service will be somewhere in “/etc/systemd/system/”. This is where customization goes. In cases where the system has possible choices for a default there will be a symbolic link pointed to the actual file. In cases where a customization overrides a default, then the content outside of “/etc/” is left alone, and the file in “/etc/systemd/system/” overrides the content when using the same file name. Remove the alternate file or symbolic link and the effect is reverted. So long as something you do doesn’t make the system unbootable it’s pretty easy to experiment.

Thank you very much for the information