Byzantium/Byzantium — Issue #48: Ensure that all initscripts support the 'status' argument and write PID files to a known location.
Author: virtadpt
Created: 2011-10-30 20:30:42+00:00
State: open
Labels: Feature request

The problem with some of the services we package is that their initscripts aren't consistent in some ways (if they have initscripts in the first place). The first problem is that they don't always support the 'status' argument to determine if a service is running. If a service is running, it should print 'running' or 'deactivated' to STDOUT where it can be captured by the control panel and parsed.

Additionally, not all services write PID files to /var/run, which causes problems when it comes to testing to make sure that services actually did come up when started from the control panel.

To verify that a service is running, the control panel takes the contents of /var/run/[servicename].pid and checks in /proc to see if a matching directory exists. If there isn't a match then it's assumed that the service didn't start up and so displays an error message to the user. if there is a match then it's assumed that the service is running, and it's flagged in the services.sqlite database as such so that it will be displayed on the node's frontpage (the "Things I support" page).

If you're writing an initscript, please ensure that you add a 'status' function to it, and also make sure that you capture the PID of the running process to /var/run/[servicename].pid, either in the initscript itself or in the configuration of the service.