Set the name of a service according to the command.

        This is only relevant if the name wasn't explicitly provided.
        Note that this is risky as it sets the name according to the
        name of the file the command is using. If two services
        use the same binary, even if their args are different, they
        will be named the same.

def _set_service_name_from_command(self, cmd):
        """Set the name of a service according to the command.

        This is only relevant if the name wasn't explicitly provided.
        Note that this is risky as it sets the name according to the
        name of the file the command is using. If two services
        use the same binary, even if their args are different, they
        will be named the same.
        """
        # TODO: Consider assign incremental integers to the name if a service
        # with the same name already exists.
        name = os.path.basename(cmd)
        logger.info(
            'Service name not supplied. Assigning name according to '
            'executable: %s', name)
        return name