Skip to content

Startup not failing if port is already in use #241

Closed
@slovdahl

Description

@slovdahl

While trying to write a systemd unit for elasticsearch_exporter, I noticed that startup doesn't fail if the process can't bind to the requested port.

A line is logged (level=error ts=2019-05-02T08:28:32.578028364Z caller=main.go:190 msg="http server quit" err="listen tcp 0.0.0.0:9114: bind: address already in use"), but the process just keeps running. In my opinion, this is a bit unexpected behaviour. Instead, the process should exist with a non-zero status code.

Is this intentional, or just an oversight?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions