Why my process does not start at boot? (OpenWrt)

I defined the following script (it's called pcap):

#!/bin/sh /etc/rc.common
# Example script
# Copyright (C) 2007 OpenWrt.org
 
START=10
STOP=15
 
start() {        
        echo start
        ./delete_pcap
        # commands to launch application
}                 
 
stop() {          
        echo stop
        # commands to kill application 
}

I put this script in the /etc/init.d folder. When I do /etc/init.d/pcap start , the start function is executed and the delete_pcap (in C language, which is in the same /etc/init.d folder) program is executed correctly. Anyway, if I do /etc/init.d/pcap enable , that should execute the delete_pcap program at each reboot, the program doesn't start when the system start . I checked in the folder /etc/rc.d and I have S10pcap file (created when I do enable). So, where is the problem? Why delete_pcap is not executed ad the system start? Thank you everybody for your help!

START=10 is a suboptimal if you are deleting stuff

thank you, the delete_pcap program deletes some .pcap file in a particular directory.

anyway, why if I do /etc/init.d/pcap enable and reboot the system, delete_pcap is not started automatically?

Use an absolute path.

2 Likes