Now the scripts inside /etc/local.d/ directory with suffix .start will be executed at system startup and all the scripts with suffix .stop will be executed during system shutdown. First make sure you have enabled local.d scripts using below steps.

Enable local.d Scripts

To start the local.d scripts at boot time, add its init.d script to the default runlevel Now start the service by making OpenRC check for stopped services in the default runlevel:

Run Script on Startup

Create a script /etc/local.d/myService.start and put your content in it. This will be executed during system boot.

Run Script on Shutdown

Create a script /etc/local.d/myService.stop and put your content in it. This will be executed during system shutdown.