Make sure a service starts after rc.local has been executed

i have a service /etc/init.d/serviced, I want to be sure that this should start after rc.local has executed in for proper operations. Is there a way to make sure that the service is executed only after rc.local has executed?

Use a lock/flag file. Your service checks for it's existence.... and backs off for X when not.

These may be of use.... I think i'd try external checks first... But they are interesting when it comes to interaction between two processes.
https://openwrt.org/docs/guide-developer/procd-init-scripts

watch	
List	Passes a list of ubus namespaces to watch - procd will subcribe to each namespace and wait for incoming ubus events which are then forwarded to registered JSON script triggers for evaluation.

file	
List	Passes a list of file names to procd to be monitored for changes. Upon starting a service, the content of each passed file is checksummed and stored as part of procd's in-memory service state. When a service reload request is processed and the checksum of one of the associated files changed, or the list of files itself changed, the running service state is invalidated and procd will restart the associated process or deliver a UNIX signal to it, depending on how the service was set up.

2 Likes

Or start it at the end of rc.local

2 Likes

I think that for some, you might want to sleep for a while to ensure that the previous services are ready. For example, if mounting a USB disk then wanting miniDLNA to serve it.

2 Likes