-
Notifications
You must be signed in to change notification settings - Fork 75
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
Exit codes are not documented in the man page #261
Comments
I'm not sure needrestart exits differently than 0 by default (I've not made exhaustive tests though but right now it's exiting 0 should my user session is running outdated binaries or not...). However, you can activate nagios mode with -p switch (equivalent of -t switch with checkrestart) and then you have different exit codes, nagios-compatible, depending on the situation. |
I think it does, yes - at least i'm seeing 0 as well as 128 when being run as part of an Ansible playbook. I tried your suggestion of adding "-p" - however, it seems it's just doing the output anymore, no more service restarts seem to happen.. Relevant config in my playbook:
If anyone has helpful pointers on how to handle that, i'd really appreciate it (just getting my feet wet with Ansible). |
I'm in the same boat using needrestart -r -a from ansible. Occasionally I see return code 128 with empty stderr and empty stdout. This is happening for months now, but I can not find out what is causing it. Running needrestart again leads to exit code 0. I would really like to know the meaning of the return code 128 to be able to decide on how to handle those situations. |
On Mon, 08 Jul 2024 00:25:31 -0700 nlsschmdt ***@***.***> wrote:
I'm in the same boat using needrestart -r -a from ansible.
Occasionally I see return code 128 with empty stderr and empty
stdout. This is happening for months now, but I can not find out what
is causing it. Running needrestart again leads to exit code 0. I
would really like to know the meaning of the return code 128 to be
able to decide on how to handle those situations.
FWIW, shell sets the high bit in the status byte to 1 (aka 128)
when the process exits due to receipt of a signal. I am unclear
on how this relates to lower-level system calls, if it does at all.
Regards,
Karl ***@***.***>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
|
Hi,
There is no documentation of needrestart's exit codes. At least not in the man page needrestart(1). Knowing exit codes could be useful. For example, when writing a shell script to email needrestart output (Issue# 24, email frontend #24) the exit code might reveal whether or not anything needs restarting and so whether or not to send an email.
The text was updated successfully, but these errors were encountered: