subscribe to our Youtube


14455 questions

17168 answers


0 members

We are migrating to our new platform at Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
1,472 views 2 comments


I have two bash scripts I want to run on start-up, but they are not being executed.

The scripts work fine over SHH and from the CLI.

The Start Script I have is:

# Put your custom commands here that should be executed once

# the system init finished. By default this file does nothing.

# GPS Logger to log coordinates every 60s


# GPS Updater to update coordinates of the 'Parked' geofence every 60s


exit 0

What am I doing wrong?

F/W is RUT9XX_R_00.06.00.4 as anything later than that doesn't have functioning GPS.


by anonymous

I have the same issue, and none of the suggestions provided across the forum are working (add delay, background process, wrap daemon in shell script and so on).

For example:

echo "Before" > /tmp/before
/usr/bin/ &
echo "After" > /tmp/after
exit 0

The 'Before' and 'After' both run, and create their respective files in /tmp/, but the shell script in the middle, does not. That shell script is a simple:


sleep 30
/usr/bin/snmp_exporter --config.file=/etc/snmp/snmp.yml 2>&1

When SSH'ing in, running the same shell script works as expected. Ownership, permissions, bits are all correct.

Putting the raw command itself, into the "Custom Scripts" section, also does not run, which is why I tried wrapping it into a shell script.

The added 'sleep' is there based on a recommendation on another similar thread, where they couldn't get it working either. The sleep didn't help here, and doesn't add any value.

I also tried this form of invocation (again, this works from the shell, does not work in "Custom Scripts")

sh -c /usr/bin/ &

Has anyone figured out why Custom Scripts aren't being run at all?

UPDATE: It turns out I needed a little more magic in the rc.local script to get it working. This now works:

exec 2> /tmp/rc.local.log
exec 1>&2
set -x

/usr/bin/snmp_exporter --config.file=/etc/snmp/snmp.yml 2>&1 &

exit 0

1 Answer

0 votes
by anonymous

you need to send them to background using & symbol.

If your scripts do not exit then executed this script hangs on /bin/
OK, thanks - that works!

Now I have another issue re geofence logic; but I'll open another thread for that.