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

Support configuration of custom systemctl status command #39

Merged

Conversation

rossta
Copy link
Contributor

@rossta rossta commented Sep 4, 2024

I use systemd in production with litestream-ruby (on Hatchbox). When I check the status of Litestream in the litestream-ruby web ui, the status reported is "not running".

Screenshot 2024-09-04 at 7 34 18 AM

The reason this is happening is that built-in command for litestream-ruby to check the status of the litestream process returns an error message:

$ systemctl status litestream
Unit litestream.service could not be found.

On Hatchbox, I need to use a slightly different command to check the status:

$ systemctl --user status myapp-litestream.service
● myapp-litestream.service - myapp-litestream
     Loaded: loaded (/home/deploy/.config/systemd/user/myapp-litestream.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed YYYY-MM-DD HH:MM:SS UTC; 20min ago
   Main PID: <PID> (ruby)
   # ...

To address this, the approach I had in mind is to make the systemctl status command configurable.

Copy link
Owner

@fractaledmind fractaledmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes needed given the evolving direction of the library

lib/litestream.rb Outdated Show resolved Hide resolved
lib/litestream.rb Outdated Show resolved Hide resolved
Some systems may use systemd to manage litestream but the status command
may differ from current implementation in Litestream Ruby. This change
allows applications to set the systemctl command to check the status.
@rossta rossta force-pushed the feat/custom-systemctl-command branch from 50c46c6 to 22f5f7a Compare September 7, 2024 00:36
@rossta
Copy link
Contributor Author

rossta commented Sep 7, 2024

Sounds good, updated the PR with the requested changes.

Copy link
Owner

@fractaledmind fractaledmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fractaledmind fractaledmind merged commit 9b6588c into fractaledmind:main Oct 22, 2024
10 checks passed
@fractaledmind
Copy link
Owner

Released in v0.12.0

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