Startup Script Help

I am trying to create a startup script to start a shell script.

To simplify the debugging I created a shell script located in /etc/init.d named ‘x’ (with execute permissions) with the following command

date >> /home/root/log

If I run this script manually it appends the date to the file /home/root/log so I can confirm if it ran.

I ran the runlevel command and the BB returns run level 1.

So I did a symbolic link the the script int /etc/init.d/x → int /etc/rc1.d/S20x
lrwxrwxrwx 1 root root 11 Jan 4 02:17 S20x → …/init.d/x

When I reboot the BB the script does not appear to run.

Is this due to an issue with starting script is runlevel 1?

If I need to move the script to rc2.d how do I change the BB to runlevel 2? If I try ‘init 2’ the BB appears to lock up.

I’ve been working on this for a couple of days and can’t seem to make this work. All comments/advise is greatly appreciated.

Thanks in advance, Neal

Thank for getting back to me. I’m running Angstrom.I tried systemd and does not run the script. I’m starting to think that runlevel1 does not run scripts.
For my own sanity I did the same script on a Rasberry Pi on Debian and it works fine.
I then took a clean build of Angstrom and ran on BB and same issue. It’s strange that I can’t get the BB to change runlevels even with a clean install.

I may try Ubuntu on BB next.

Do you have any other suggestions?

All the best,
Neal Zipper