fixes #8626 by reverting 0d8b81cd
Merge pull request #8627 from rghe/devel

fixes #8626 by reverting 0d8b81cd
LinuxService: check properly if systemd is running

Use a pure Python reimplementation of the [sd_booted(3)][1] function
from [systemd v210][2].

[1]: http://www.freedesktop.org/software/systemd/man/sd_booted.html
[2]: http://cgit.freedesktop.org/systemd/systemd-stable/tree/src/libsystemd/sd-daemon/sd-daemon.c?id=v210#n465
Transform comment into docstring
LinuxService: use the same logic as systemd for appending .service to an unit

There's no need for complex rules to determine if `.service` should be
appended to a unit's name, just do like systemd does.  For more details
see commit [696c245a23d55e4249651573eb9c61b68e61580c][1] and
[`unit_name_mangle`][2] from systemd.

[1]: http://cgit.freedesktop.org/systemd/systemd/commit/?id=696c245a23d55e4249651573eb9c61b68e61580c
[2]: http://cgit.freedesktop.org/systemd/systemd/tree/src/shared/unit-name.c?id=696c245a23d55e4249651573eb9c61b68e61580c#n501
LinuxService: check properly if systemd manages the unit

There's no need to list and look at all the unit files, just check the
[load state][1] of the current unit by running `systemctl -p LoadUnit show`.

This also covers cases like when an unit is masked (which means that
systemd can't start or enable it).

[1]: http://cgit.freedesktop.org/systemd/systemd-stable/tree/src/shared/unit-name.c?h=v208-stable#n52
LinuxService.get_service_tools: check for systemd first

Check for systemd first then for legacy init systems. This simplifies
the code.
LinuxService: d.get(k, None) -> d.get(k)

From the documentation:
> D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.

So there's no need for the `None` parameter.