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 better ipc communication to ghost run process #472
Comments
To nail down the problem of this issue, i would like to sum this up a little.
So the CLI must notify Could be useful: From https://www.freedesktop.org/software/systemd/man/systemd.service.html
We are using type
So using type You can proof this by:
I've tested With Edited: |
So I just tried that node-systemd-daemon library (it wasn't around when I first tried messing around with the notify stuff), unfortunately it's got an optional dependency that requires |
Here is a little summary why we should not use C binding
|
closes TryGhost#472 - has no tests yet - PR for last dicussions [ci skip]
closes TryGhost#472 - has no tests yet - PR for last dicussions [ci skip]
closes TryGhost#472 - added port polling utility - general process manager class offers `ensureStarted` function - systemd extension makes use of `ensureStarted`
closes TryGhost#472 - added port polling utility - general process manager class offers `ensureStarted` function - systemd extension makes use of `ensureStarted`
closes TryGhost#472 - added port polling utility - general process manager class offers `ensureStarted` function - systemd extension makes use of `ensureStarted`
closes TryGhost#472 - added port polling utility - general process manager class offers `ensureStarted` function - systemd extension makes use of `ensureStarted`
closes #472 - added port polling utility - general process manager class offers `ensureStarted` function - systemd extension makes use of `ensureStarted`
One thing that can be somewhat confusing currently when using the systemd process manager in the CLI is the fact that
ghost start
exits quickly with the message that ghost has started, when in fact it can sometimes take 20-30 seconds to actually start (time may vary from server to server based on a number of factors). Conversely, when you runghost start
using the local process manager, it doesn't exit as quickly, but when it does exit, ghost has started.The reason for this difference is that the local process manager spawns the
ghost run
subprocess directly, and thus can communicate with it over an IPC tunnel, exiting once ghost has fully started. Systemd, on the other hand, must go through the intermediary process ofsystemctl
, which has no way of letting the ghost start process know once the process has completely started. Other process manager extensions may also have the same issue depending on how they're implemented and how the underlying process manager functions.To make things more consistent between process managers, the CLI should use a more advanced method of ipc tunneling (using something like https://www.npmjs.com/package/node-ipc).
Note: this would also potentially open up opportunities for improvement in other areas: for example,
ghost update
could interface with the ghost run process and tell it to run in maintenance mode before modifying the database.The text was updated successfully, but these errors were encountered: