Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd please sign up again. Thanks!

How to run an executable file after boot up immediately?

Discussion in 'Command Line' started by vikranth, Jul 21, 2017.

  1. vikranth

    vikranth New Member

    Jul 21, 2017
    Likes Received:
    I have one a.out executable file, now I need to run this file immediately boot up my orange pi. I am using Debian 8.

  2. Rob

    Rob Administrator
    Staff Member

    Oct 27, 2011
    Likes Received:
    Hey there - welcome to the forum!

    There are multiple ways to do this. Regardless of which distribution you run, you can use cron to accomplish running scripts or commands etc.. on boot with a cron entry similar to this:

    @reboot /path/to/script
    I use this on one of my servers running CentOS and it works regardless of if i'm rebooting the machine or booting from being shut down. I have heard/read that it may not run from a cold boot but not sure if that's going to be a distribution thing or what.

    Give that a shot and let us know if it gets you going.

    I'm sure others will come along and post other options for you as well.
    vikranth and atanere like this.
  3. Thsnos023

    Thsnos023 New Member

    Dec 17, 2017
    Likes Received:
    Add your script to the /etc/init.d/ directory and enable it

    sudo update-rc.d <script> defaults
    sudo update-rc.d <script> enable

    Make sure that root is the script owner
    wizardfromoz likes this.

Share This Page