Skip to content

sv status exit code for service masked by its log #20

Description

@garthk

sv(8) says:

The sv program can be sym-linked to /etc/init.d/ to provide an LSB init script interface. The service to be controlled then is specified by the base name of the "init script".

If sv is called with a base name other than sv: it exits 1 on timeout or trouble sending the command; if the command is status, it exits 3 if the service is down, and 4 if the status is unknown; it exits 2 on wrong usage, and 151 on error.

This isn't entirely true. If the service has a log, the exit code instead reflects the status of the log. In src/sv.c:154-176 you'll see rc updated if chdir("log") and svstatus_get() succeed, after which the if (lsb) branch to the switch will call done reflecting the log's status.

This strikes me as a bug in the code, not the man page.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions