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

[QA] Upgrade procedure fails to shut down ocis when using systemd #1052

Closed
jnweiger opened this issue Nov 18, 2024 · 2 comments · Fixed by #1055
Closed

[QA] Upgrade procedure fails to shut down ocis when using systemd #1052

jnweiger opened this issue Nov 18, 2024 · 2 comments · Fixed by #1055
Assignees

Comments

@jnweiger
Copy link
Contributor

jnweiger commented Nov 18, 2024

The upgrade guide correctly suggests to stop ocis before updating.
The binary / bare metal install case is discussed in https://github.com/owncloud/docs-ocis/blob/2360692c5141e4fb8145a80fe46f52b6a7a87c4a/modules/ROOT/pages/migration/upgrading_5.0.x_7.0.0.adoc#2-shut-down-the-infinite-scale-instance

which correctly refers the user to:
https://github.com/owncloud/docs-ocis/blob/master/modules/ROOT/pages/depl-examples/minimal-bare-metal.adoc#stopping-infinite-scale

There we learn, that for a graceful and complete shutdown, a rather complex shell pipeline should be used:

ps -ax|grep "ocis server" | grep -v grep | awk '{ print $1 }' |   xargs sudo kill -15

But: When the bare metal install was done according to
https://doc.owncloud.com/ocis/next/depl-examples/bare-metal.html#setup-the-systemd-service
this will not have the desired effect.

Systemd treats the kill -15 command as an incorrect shutdown and restarts ocis immediately. This behavior is correctly configured in the service file via Restart=always - This is a valuable safeguard against spurious crashes.

Thus following this procedure, we'll have ocis unintentionally running while doing the remaining upgrade steps.
This most likely leads to errors, frustrated users or even data-loss.

I suggest, that for each setup, the respective tooling is used and we properly distinguish the systemd case from other binary deployments.
For a systemd setup, the correct command for a graceful and complete shutdown is: service ocis stop

@jnweiger
Copy link
Contributor Author

For the non-systemd case, I'd suggest to consider killall -v -s 15 ocis
(or a regexp variation of this)

@mmattel
Copy link
Contributor

mmattel commented Nov 18, 2024

ok. this sounds valid. I will create a new PR independent to the migration so we can backport to cover:

  • killall
  • systemd stop

Thanks for the investigation in filing the issue 👍

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

Successfully merging a pull request may close this issue.

2 participants