-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add option to return an exit-code when occ status signals an update is needed #35873
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise you would need to add a tab on each line
54853d0
to
b99c041
Compare
@leegarrett Code style checker still complains, this time about empty lines and spacing: https://github.com/nextcloud/server/actions/runs/3824719618/jobs/6507559027 Also for the comments I’d prefer if you avoid using |
Also last commit is missing signoff and DCO complains: https://github.com/nextcloud/server/pull/35873/checks?check_run_id=10400685089 |
Running `./occ status -e` will produce any output. However, it will: exit 0 during normal operation, exit 1 when in maintenance mode, exit 2 when `./occ upgrade` is needed. Signed-off-by: Lee Garrett <[email protected]>
5087f3a
to
fba906e
Compare
I've hopefully fixed the issue now. Since the 2nd commit wasn't signed off, I've now just squashed it with the first, removed the extra whitespace, and removed the comments. They didn't add much information, anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my question on output, but otherwise looks good, codesniffer and DCO are both happy. Failure in drone is unrelated.
Signed-off-by: Joas Schilling <[email protected]>
Not sure if resolved conversations get notified, so here's a copy/paste of it: Yes, you don't want output e.g. in |
They do,
That makes sense. Will make it so. |
Signed-off-by: Joas Schilling <[email protected]>
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
Hello, can we also get this backported to v25? |
usually we only backport bugfixes, but it's arguable here. I will ask some people |
/backport to stable25 |
No documentation on this? |
Should be added to https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html yes. |
FYI, the doc update PR is at nextcloud/documentation#9583 |
hello @leegarrett |
It's linked above nextcloud/documentation#9583 |
Signed-off-by: Lee Garrett [email protected]
Summary
This is an improved version of my earlier PR #35830. This is now a parameter to
status
, so it allows for adding more return codes later, which can then for example be consumed in systemd units, or monitoring checks.It adds a parameter that can be used in scripts.
./occ status -e
returns 0 when operating normally, and 1 if there is maintenance mode, 2 if./occ upgrade
is required.TODO
Checklist