Callback to run init-scripts before flytos starts


#1

Hi,

We have some scripts that we want to run as late as possible during boot but still before flytOS starts. Currently we have modified the /etc/init.d/flytos file and inserted the script calls there, but that feels kind of wrong. I guess this file might get changed at flytOS updates.
So my request is for some upgrade-persistent way of runing init-scripts at boot.


#2

Yes. You are correct. The file would get updated on auto-update.
I would suggest you to create your own init script.

You can copy the initial boilerplate:

#!/bin/bash -i

### BEGIN INIT INFO
# Provides:          script_name
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     4
# Default-Stop:      0 6
# Short-Description: Script Description
### END INIT INFO

Now , add your commands/scripts that you would like to trigger.
Once done, call update-rc.d.
To ensure, it runs before FlytOS, make sure its number (S0x) is lesser than that of FlytOS file present in /etc/rc4.d/S0xflytos


#3

Thanks alot @srv-admin


#4