Services are not starting, sometimes

Greetings All

I have an issue since updated OpenWRT to version 18.06.2. Before everything was fine.

After reboot, sometimes, SQM service and Vnstat service are not starting, at least not properly. It's not like both serivces fails after the same reboot. Sometimes it's SQM serivce, other time Vnstat.

I am pretty noob in linux so really need your help guys.

My question is:

How can i check if service is running on OpenWRT ?

I tried:

service service_name status

but it does not work on OpenWRT as status is not correct paramter on OpenWRT.

Thanks for any help guys.

If there is a SXXsomeservice link in /etc/rc.d/ then the service is slated for startup. It doesn't mean it is still running (or was started successfully).

ps w will give you a list of running processes (assuming you are using the busybox-supplied version)

1 Like

service servicename ... does not work on openwrt.
You might check "logread" or "dmesg" whether any info from the start of the services in question to be found. Good chance, they immediately exited because of some type of error.

1 Like

Except the following

Available commands:
        start   Start the service
        stop    Stop the service
        restart Restart the service
        reload  Reload configuration files (or restart if service does not implement reload)
        enable  Enable service autostart
        disable Disable service autostart

You are correct, it works (now).
My apologies.
Looks like some type of alias for "/etc/init.d/service command"
Any idea, how/where it is implemented ?


service() {
	[ -f "/etc/init.d/$1" ] || {
		echo "service "'"'"$1"'"'" not found, the following services are available:"
		ls "/etc/init.d"
		return 1

Missing the service function meas the OP has preserved/restored some previous release configuration.
Doing so is not completely safe and increases the chance to encounter all kinds of issues.

I'm not sure he is missing the service function; it could be that he just tried service servicename status, which doesn't seem to work with OpenWrt. I think he can try service servicename start or service servicename stop to see if he is missing it or not.

1 Like

I haven't had service work on my deployments. It was only by searching for it that I found it. It's as if profile isn't being sourced. Never bothered me enough to track it down.