SUSE / machinery

A systems management toolkit for Linux
GNU General Public License v3.0
158 stars 32 forks source link

Detection of Init system needs refactoring #1842

Open greygoo opened 8 years ago

greygoo commented 8 years ago

We currently detect the init system by looking at certain binaries to be available in the system. this worked well for a small number of supported systems, but looking at ubuntu and older RHEL systems showed that this method is not very reliable especially on systems that use more than one init system tool set to handle its services. E.g. RHEL6 uses an old version of upstart while still managing the services using sysV tools while ubuntu having a newer upstart service does use the upstart system but still manages a certain number of services with sysV init tools. We need to clean up the code for determining the init system and tools used for service management in order to be able to easily cover additional future supported systems.

mschnitzer commented 8 years ago

Maybe this can help here: http://unix.stackexchange.com/questions/18209/detect-init-system-using-the-shell

Parsing the process list should work, I think.