[HOW TO] Run your own script on system startup

You can follow the the steps below to run the demon on system startup
1. login NAS as "root" via ssh client (e.g. Utility like "Putty" on Windows or "terminal" on Mac)
2. Put your script under /usr/local/etc/init.d/
3. Rename script name to SXXscript_name (S00 ~ S99: script execute order, S00 is in order of first, S99 is in order of last)
e.g.
4. Modify execute permission for this script
e.g.
5. You can try to execute this script, and check result
e.g.
6. After system restart, your script should be run automatically
1. login NAS as "root" via ssh client (e.g. Utility like "Putty" on Windows or "terminal" on Mac)
2. Put your script under /usr/local/etc/init.d/
3. Rename script name to SXXscript_name (S00 ~ S99: script execute order, S00 is in order of first, S99 is in order of last)
e.g.
- Code: Select all
# mv /usr/local/etc/init.d/first_autorun.sh /usr/local/etc/init.d/S00first
# mv /usr/local/etc/init.d/last_autorun.py /usr/local/etc/init.d/S99last
4. Modify execute permission for this script
e.g.
- Code: Select all
# chmod +x /usr/local/etc/init.d/S00first
# chmod +x /usr/local/etc/init.d/S99last
5. You can try to execute this script, and check result
e.g.
- Code: Select all
# /usr/local/etc/init.d/S01autorun
6. After system restart, your script should be run automatically