[Important Security Notice] Fake Qfinder Pro Websites Detected. Learn more >

How to Confirm Whether autorun.sh Actually Runs at Boot


Last modified date: 2026-03-31

Applicable Products

  • Any QNAP NAS running QTS or QuTS hero that supports custom autorun.sh scripts

Scenario

  • You refer to Running Your Own Application at Startup and created an autorun.sh script under /tmp/config with executable permissions (-rwxr-xr-x).
  • The autorun feature is enabled in Control Panel > Hardware.
  • After rebooting, the expected actions do not occur. It is unclear whether:
    • autorun.sh was never triggered, or
    • autorun.sh ran, but some commands failed due to timing or environment differences.
  • Running the same script manually via SSH works as expected, which makes the root cause harder to identify.

Solution

The most direct way to confirm that autorun.sh runs at boot is to add a buzzer command and a log entry at the beginning of the script.

  • If you hear a beep after boot, autorun.sh was triggered.
  • If you hear a beep but the main functionality does not work, commands later in the script may be failing because a required network interface, filesystem, or service is not ready.
Prerequisites
  • autorun.sh is stored at /tmp/config/autorun.sh.
  • The file is executable: -rwxr-xr-x.
  • The autorun feature is enabled in Control Panel > Hardware.

To implement this, first reduce autorun.sh to a minimal observable version:

#!/bin/bash

# Minimal execution proof
echo "autorun.sh started at $(date)" >> /tmp/autorun.log
hal_app --se_buzzer enc_id=0,mode=0

Buzzer commands

  • Short beep: hal_app --se_buzzer enc_id=0,mode=0
  • Long beep: hal_app --se_buzzer enc_id=0,mode=1

Recommended usage:

  • Place two short beeps at the very start: indicates that autorun.sh has started and two short beeps at the end of autorun.sh .
#!/bin/bash

echo "autorun.sh started at $(date)" >> /tmp/autorun.log
hal_app --se_buzzer enc_id=0,mode=0
hal_app --se_buzzer enc_id=0,mode=0

# Your actual configuration below
sleep 5
# ... your commands here ...

echo "autorun.sh completed at $(date)" >> /tmp/autorun.log
hal_app --se_buzzer enc_id=0,mode=0
hal_app --se_buzzer enc_id=0,mode=0

Interpreting the results

Note: QNAP NAS systems emit beep sounds at specific points during normal boot:

  • Power-on beep: Single short beep when power is applied (very early in boot, before autorun.sh runs)
  • System-starting beep Single short beep when the operating system starts loading (before autorun.sh runs)
  • System-ready beep: Usually a long beep after the OS has initialized and services are starting (after autorun.sh runs )

In order to distinguish autorun.sh beeps from the system boot beeps, you may add a differenet beep combinations in your autorun.sh during debug stage.

Besides, you can also view /tmp/autorun.log to check whether autorun.sh  is executed.  


Warnings

  • autorun.sh runs with elevated privileges during boot. Ensure that the syntax is correct to avoid system instability.
  • The buzzer confirms that the script was triggered, but does not guarantee that every command inside it succeeded.

Further Reading

Was this article helpful?

100% of people think it helps.
Thank you for your feedback.

Please tell us how this article can be improved:

If you want to provide additional feedback, please include it below.

Choose specification

      Show more Less
      Choose Your Country or Region
      open menu
      back to top