I am using Debian OS I have one executable file (a.out), Now I need to run this file after boot up Immediately.

I tried with etc/rc.local.

Any suggestion?


  • yes, my suggestion is rc.local. – Peter Jul 22 '17 at 8:37
  • Can you please send me a sample code? How to add a.out file to rc.local file? – Vikranth Jul 22 '17 at 8:39
  • 1
    No, could you please provide sufficient information about what you have tried? Path to file, permissions of the file and so on. The exact line you added to rc.local. – Peter Jul 22 '17 at 8:49
  • Yes, and if you want help, you should provide more information. Exact line you added to rc.local, path to your a.out and the permissions of a.out. – Peter Jul 22 '17 at 9:02
  • yes, I gave full permissions of a.out file using chmod 755 a.out, in rc.local file added line is /home/user/script.sh – Vikranth Jul 22 '17 at 9:05

It greatly depends on your init subsystem, which could be some sysvinit thing with runlevels, some systemd thing, or something else (e.g. runit).

You need to investigate what init your computer (and distribution) has, and dive into the documentation of its init program.

Recent Debian distributions are generally using systemd. See also this.

BTW, read about crontab(5). Perhaps a @reboot entry might be enough. You might use crontab(1) to add it.

Notice that in init related scripts and in crontab jobs, the PATH is not initialized from your user's settings (but has a small system wide default). Practically speaking, better use full executable file path in such things.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.