How to run any application in reboot startup


When I am trying to run any application or script in Terminal, it is running properly.

I am not able to run the same in reboot startup by using /etc/rc.local

Please Help me!!

Aravindan K

How it runs changes with the program’s dependencies. Some programs require the GUI to be running (either a physical GUI login or a virtual X server), especially many CUDA-related programs (one doesn’t need a desktop to run for X11 to run, but the GPU driver loads into the X11 server and CUDA talks to X11 to talk to the driver).

Can you give full details of your program? Is it one you can run on the command line outside of the GUI with no GUI login?

thanks for your response .i am attaching the application and steps which i followed .

1.command run step
nvidia@tegra-ubuntu:~/darknet-master$ ./darknet detect cfg/yolov3-tiny-obj.cfg yolov3-tiny-obj_8000.weights data/img1.jpg

output windows


i believe my target having sufficient X support,because i could see the application output window while running from command line.Now i am trying to execute the same application from startup and show the output in home window.

thanks & regards
Aravindan k


I manage to create & add the script in /etc/rc5.d/ and I could run it manually from user-space command line. But how to start from startup?

nvidia@tegra-ubuntu:~ cat /etc/rc5.d/ #!/bin/sh cd /home/nvidia/darknet-master ./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg & nvidia@tegra-ubuntu:~ runlevel
N 5

Also symlinked the /etc/rc5.d/ script with init.d/

$ ls -al /etc/rc5.d/

lrwxrwxrwx 1 root root 14 Dec 12 2016 S04gpsd -> …/init.d/gpsd
lrwxrwxrwx 1 root root 15 May 3 2016 S04saned -> …/init.d/saned
lrwxrwxrwx 1 root root 18 May 3 2016 S05plymouth -> …/init.d/plymouth
lrwxrwxrwx 1 root root 18 May 3 2016 S05rc.local -> …/init.d/rc.local
lrwxrwxrwx 1 root root 21 Aug 17 14:57 -> …/init.d/

Please advice to fixup this issue.


If this requires output to the GUI, or if CUDA requires a context, then you must have the logged in GUI session running before the application runs. This implies making it part of the user login rather than that of system startup. You can add a virtual X server, and then run that in the same startup as you use to start up the application (you’d start the virtual X as a service, and then your app would mark the virtual X as a dependence so that starts first). A virtual server is just like a GUI, except there isn’t a real monitor. Your startup would have to set the DISPLAY environment variable to whatever the virtual X starts as.

I don’t have any recommendations on a specific virtual X server, but others might have a recommendation.