Details
Description
Mesos agent refuses to start due to a failure caused by the systemd-specific code:
E0220 12:03:02.943467 22298 main.cpp:670] EXIT with status 1: Expected exactly one socket with name unknown, got 0 instead
It turns out that some versions of systemd do not set environment variables `LISTEN_PID`, `LISTEN_FDS` and `LISTEN_FDNAMES` to the Mesos agent process, if its systemd unit is ill-formed. If this happens, `listenFdsWithName` returns an empty list, therefore leading to the error above.
After fixing the problem with the systemd unit, systemd sets the value for `LISTEN_FDNAMES` taken from the `FileDescriptorName` field. In our case, the env variable is set to `systemd:dcos-mesos-slave`. Since the value is expected to be equal to "systemd:unknown" (for the compatibility with older systemd versions), the mismatch of values happens and we see the same error message.