I need to run a script on system startup, but the Linux version is very old, so:
- There is no
rc.local
. Even when I created it and gave it a command, it was never run.- There is no
crontab
at all.- Adding the script to
init.d
also didn’t produce any result.- 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:
$ 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
.
$ 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
.
$ runlevel
returns:N 5
.
$ cat /etc/issue
returns nothing.
$ cat /etc/*-release
returns error ‘No such file or directory’.
$ lsb_release -a
returns error ‘command not found’.
$ 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?
Answer
I found the solution.
The command: ln -s /etc/rc.local /etc/rc5.d/S99rclocal
gets the script to run on startup for this embedded Linux version.
Attribution
Source : Link , Question Author : Vidak , Answer Author : Vidak