0

System info

  • Hardware: GL iNET X3000
  • OS: OpenWrt 21.02-SNAPSHOT
  • Shell: ash

Now, I will let the output speak for itself:

root@GL-X3000:~# service prometheus-node-exporter-lua restart root@GL-X3000:~# service --status-all | grep prometheus /etc/init.d/prometheus-node-exporter-lua enabled stopped root@GL-X3000:~# service prometheus-node-exporter-lua status active with no instances 

Also, logread | grep prometheus and ss -tulpn | grep 9100 are empty for the relevant time window. Furthermore, nmap -p 9100 -sUT 192.168.8.0/24 from another node in the network shows the port as closed.

The service is both "stopped" and "active with no instances" simultaneously? To me that is very contradictory and makes no sense. What is actually going on?

Thank you in advance.

2
  • running, but is idle (nothing to do) ... it's waiting to service some event ... there are no events being serviced at this time Commented Nov 12 at 19:33
  • To me, that does not answer the question. You are just focusing on one side of the contradiction without explaining the other, which is the whole point of the question. It is not shown as "idle" or "active" as an output of service --status-all. It is shown as "stopped". Commented Nov 12 at 19:50

1 Answer 1

0

service is usually a shell script that calls SysVinit-style service start/stop scripts located within /etc/init.d/.

service prometheus-node-exporter-lua status should end up calling /etc/init.d/prometheus-node-exporter-lua status, and the output and the exit code comes directly from the actual /etc/init.d/prometheus-node-exporter-lua. The output and the exit code may or may not be standardized: they might follow the current LSB specification, some older version of the LSB specification, or - especially if the software is ported from another unix-like system - a specification or convention from the originating unix-like system, or no particular specification at all.

service --status-all attempts to produce a unified list of all services and their statuses. It probably does that by calling each script in /etc/init.d/ with the status argument, throwing away the textual output, and examining the exit code. If the distribution has added a requirement that any SysVinit services must create a lock file (e.g. /var/lock/subsys/<service_name>.lock RedHat used to require before switching to systemd) when starting and remove it when stopping, another possible implementation is that it checks for the presence of these lock files to determine the started/stopped state.

If the SysVinit service start/stop script for a particular service does not fully conform to the expectations of the service --status-all script, the --status-all listing may be incorrect for that service.

The output of commands like service prometheus-node-exporter-lua status comes tailored for that particular service, so in absence of any other evidence, I would pay more attention to the service-specific status query than the --status-all overview.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.