hilbert / hilbert-cli

Backend management tools: CLI
Apache License 2.0
6 stars 2 forks source link

Add app_restart command #86

Open porst17 opened 6 years ago

porst17 commented 6 years ago

... to server and station scripts

malex984 commented 6 years ago

plan

  1. detect the currently running (or exited or crashed) local app and restart it
  2. otherwise - start the default one
elondaits commented 6 years ago

Even if you add this (which might be OK) I probably won't use it in the dashboard...

... I need to block the UI until the app is up, but I have no way to detect the progress of the restart process and I might see the new process up and think it's the original one (unless I was able to track process via pid).

So it's easier if I stop it myself, wait until checkMK tells me it's down, and then start it again and wait for checkMK to tell me it's up.

porst17 commented 6 years ago

When app_restart exits, the new process will be running or at least the container that contains the app, but that's everything the top1 service check checks anyway. For the dashboard, you probably need some kind of additional metadata to tell apart the different instances of the same app. The timestamp of the service check alone is not enough as we already noticed, but if we add the container id (or some other unique identifier) to the output of top1 it should be enough.

But that shouldn't be discussed here, because hilbert-cli knows nothing about monitoring.

elondaits commented 6 years ago

I'm discussing this here just in the spirit of not adding a feature if the only intention is that I use it because maybe I won't.

Originally I was told (and there was never any documentation to the contrary) that I should treat the hilbert cli scripts (now hilbert-cli) as "async calls". Even though now I could consider that the app is in effect restarted once the call to hilbert-cli ends I always understood that perhaps I should wait for it to report back through checkMK because:

So basically:

porst17 commented 6 years ago

app_restart is necessary on the CLI as well, regardless of the dashboard. Same with reboot.

elondaits commented 6 years ago

Some time ago we had kind of said that users should only use the hilbert-ui cli, which uses HTTP calls to the Hilbert server and only performs operations if its safe and keeping the UI server as informed as possible of the state of stations. Is this no longer true?

porst17 commented 6 years ago

hilbert-cli is used a lot during development and debugging - also during installation in the museum. This is done by tech-savvy people and turn-around time and instant debug output matters more then "safe operation". During normal operation of the museum, however, people should not use hilbert-cli but only the hilbert-ui.

Unfortunately, the hilbert-ui cli is currently not exposed to users. It is contained inside the mng container, so regular users without docker knowledge can't access it.