Run Scripts When the System Boots

If you would like to run scripts when the system is booting up or shutting down, you can write scripts in start-stop-status. This script will be executed with the "start" or "stop" parameter, when the package is enabled. If you want to execute a script during the boot-up or shut-down process, you can put a start-up script in /usr/local/etc/rc.d/. Below are the rules for the start-up script:

  1. It must contain the suffix ".sh". For example, "myprog.sh".
  2. The permission must be 755.
  3. It must contain the options of "start" and "stop". When the system boots up, it will call myprog.sh start; when it shuts down, it will call myprog.sh stop.