Page 1 of 1

How to auto start a excute file when start up

Posted: 2025-03-27 4:31
by quocan123
Hi, I have compiled the example luckfox_pico_rtsp_yolov5_demo. I want it to auto-run when I boost up RV1106. I have followed the tutorial in the wiki, but it did not work.
Note: When I try run this /etc/init.d/S99yolov5 start on terminal to test my script it work fine. But when I reboot, script look like not run or error.
This is my step:
Create a script in /etc/init.d/S99yolov5
chmod +x S99yolov5
reboot
This is my code in script

Code: Select all

#!/bin/sh

case $1 in
    start)
        echo "Starting..."
        cd /Projects
        /oem/usr/bin/RkLunch-stop.sh
        /Projects/luckfox_pico_rtsp_yolov5
        ;;
    stop)
        echo "Stopping..."
        ;;
    *)
        exit 1
        ;;
esac


Re: How to auto start a excute file when start up

Posted: 2025-03-27 6:45
by Crocodile
Hello, will the startup script after adding environment variables to give it a try

Code: Select all

#!/bin/sh
[ -f /etc/profile.d/RkEnv.sh ] && source /etc/profile.d/RkEnv.sh
case $1 in
    start)
        echo "Starting..."
        cd /Projects
        /oem/usr/bin/RkLunch-stop.sh
        /Projects/luckfox_pico_rtsp_yolov5
        ;;
    stop)
        echo "Stopping..."
        ;;
    *)
        exit 1
        ;;
esac

Re: How to auto start a excute file when start up

Posted: 2025-03-27 7:30
by quocan123
Hi, thank you, it work