Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

align exit-code with systemd standard #58

Open
gdraheim opened this issue Mar 9, 2019 · 1 comment
Open

align exit-code with systemd standard #58

gdraheim opened this issue Mar 9, 2019 · 1 comment

Comments

@gdraheim
Copy link
Owner

gdraheim commented Mar 9, 2019

There is a section in the systemd documentation that list LSB exit codes that should be followed. I know that quite some of the result values do not quite match but it would be better to follow style when having not checked what the systemd systemctl command returns.

https://www.freedesktop.org/software/systemd/man/systemd.exec.html

  • 0 EXIT_SUCCESS Generic success code.
  • 1 EXIT_FAILURE Generic failure or unspecified error.
  • 2 EXIT_INVALIDARGUMENT Invalid or excess arguments.
  • 3 EXIT_NOTIMPLEMENTED Unimplemented feature.
  • 4 EXIT_NOPERMISSION The user has insufficient privileges.
  • 5 EXIT_NOTINSTALLED The program is not installed.
  • 6 EXIT_NOTCONFIGURED The program is not configured.
  • 7 EXIT_NOTRUNNING The program is not running.

plus exit codes 200... 214

@gdraheim
Copy link
Owner Author

gdraheim commented Mar 9, 2019

On the documentation for the systemctl command a slightly different table is used

https://www.freedesktop.org/software/systemd/man/systemctl.html

  • 0 "program is running or service is OK" .. unit is active
  • 1 "program is dead and /var/run pid file exists" .. unit not failed (used by is-failed)
  • 2 "program is dead and /var/lock lock file exists" ... unused
  • 3 "program is not running" ... unit is not active
  • 4 "program or service status is unknown" .. no such unit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant