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

Change shutdown logic #128

Closed
wants to merge 1 commit into from
Closed

Conversation

Micha-he
Copy link

Could it be that the logic for the shutdown is reversed?

Should the shutdown not only be executed by $SHUTDOWN=1 ?

Signed-off-by: Michael Schröder <[email protected]>
@ecdye
Copy link
Owner

ecdye commented Jan 16, 2025

You would think, however because of service conflicts if you do it that way it will not complete properly because systemctl won't properly wait for those to stop before letting us continue.

Basically what ends up happening is sometimes we will only manage to partially sync. The other orderings in the service file should generally be sufficient to ensure all cases are covered.

Do some testing and check if things sync properly and I think you'll find that they don't.

@Micha-he
Copy link
Author

Micha-he commented Jan 16, 2025

I'm not an linux expert... Here at my openhabian system:

  • the command "systemctl list-jobs" lists no jobs
  • then the variable $SHUTDOWN isn't set (which seems to be ok)
  • and this unset var should restart the services in the lines 461/476 ???

In my opinion, if no jobs are listed, nothing needs to be restarted !? Or ?

@ecdye
Copy link
Owner

ecdye commented Jan 16, 2025

So I think you might be confusing what the -Z flag does. It checks if the variable is not set (i.e. if we are in the middle of a shutdown or reboot it will be set) and if the flag is set then we don't stop or restart the services. If the flag is not set it will stop and start services like normal.

@Micha-he
Copy link
Author

Ok, now I understand it. Then I can close the pull-request again. Thanks for the explanation.

@Micha-he Micha-he closed this Jan 16, 2025
@Micha-he Micha-he deleted the MaybeWrongShutdownLogic branch January 17, 2025 07:04
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 this pull request may close these issues.

2 participants