-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Implement occ status command via return codes #35704
Comments
Hey, sounds good to me. https://github.com/nextcloud/server/blob/master/core/Command/Maintenance/Mode.php is the file to modify. Would you mind sending a pull request? I guess everything you need is already in the file ;) |
|
Or the same with this occ command combined with grep:
|
Thanks, and done in PR #35830. I took a look at |
The two above mentioned minimally more complex methods to programmatically check for maintenance mode already now do not make this redundant? |
I'm aware that you can do this over a shell call. However:
|
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]>
I've done a second PR which I think is overall cleaner and better thought out. It's a parameter to |
The new PR also avoids the negation that the old one was plagued with. |
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]>
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]>
Implement occ status command via return codes v2 (Fixes: #35704)
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]>
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]> Signed-off-by: Akhil <[email protected]>
How to use GitHub
I propose the
--check-if-disabled
flag toocc maintenance:mode
. It doesn't write any output, it just returns 0 if maintenance mode is off, and 1 if it's on.This allows to programmatically check for maintenance mode, which makes automation easier. It allows us to use it as an conditional for the cron job (e.g.
ExecCondition
in the systemd unit), so the cron job will be skipped when maintenance mode is running. Currently it generates an admin email every 5 minutes during maintenance mode.The text was updated successfully, but these errors were encountered: