I need to run a script on system startup, but the Linux version is very old, so:

  1. There is no rc.local. Even when I created it and gave it a command, it was never run.
  2. There is no crontab at all.
  3. Adding the script to init.d also didn't produce any result.
  4. Obviously there is no Upstart app, and it's not possible to install as I can only access the device through ssh.

I'm sure the script itself works, as it works when I manually run it of course. The device is an embedded Linux device (Ettus E100, link). My Linux version is 3.0.0, and here is the exact version:

  1. $ cat /proc/version returns: Linux version 3.0.0 (oe-classic@oebuild) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #1 Thu Mar 28 18:15:38 PDT 2013.

  2. $ dmesg | head -1 returns: [ 0.000000] Linux version 3.0.0 (oe-classic@oebuild) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #1 Thu Mar 28 18:15:38 PDT 2013.

  3. $ runlevel returns: N 5.

  4. $ cat /etc/issue returns nothing.

  5. $ cat /etc/*-release returns error 'No such file or directory'.

  6. $ lsb_release -a returns error 'command not found'.

  7. $ uname -a returns: Linux ettus-e1xx 3.0.0 #1 Thu Mar 28 18:15:38 PDT 2013 armv7l GNU/Linux.

Not sure how else to check my distribution.

Are there any alternative means to get the script to run at startup?

  • 1
    rc.local is ancient, however not all Linux distributions use it. Please include in the description of the problem the Linux distribution. Also show us the ouput of the command "runlevel" Nov 19 '15 at 10:10
  • embedded Linux? Nov 19 '15 at 10:28
  • @RuiFRibeiro Hello, I edited the answer, and yes, it's embedded Linux.
    – Vidak
    Nov 19 '15 at 10:38
  • Interesting, running arm at home too, though it is Debian Nov 19 '15 at 10:50

You are running embedded Linux, so it is somewhat limited in functionality. You seem however to have Sys V init, so we can emulate an rc.local for you.

Create a file /etc/rc.local with the instructions you need, and run this command:

#ln -s /etc/rc.local /etc/rc5.d/S99rclocal

or if you have sudo:

$sudo ln -s /etc/rc.local /etc/rc5.d/S99rclocal
  • Thank you, it works perfectly!! I tried to link it to the rc5.d, but not the S99rclocal one.
    – Vidak
    Nov 19 '15 at 10:57

If your server use the original System V init daemon, you can use as well the /etc/inittab file.

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.