Skip to content

Support configuration of custom systemctl status command#39

Merged
fractaledmind merged 1 commit into
fractaledmind:mainfrom
rossta:feat/custom-systemctl-command
Oct 22, 2024
Merged

Support configuration of custom systemctl status command#39
fractaledmind merged 1 commit into
fractaledmind:mainfrom
rossta:feat/custom-systemctl-command

Conversation

@rossta

@rossta rossta commented Sep 4, 2024

Copy link
Copy Markdown
Contributor

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.

@fractaledmind fractaledmind left a comment

Copy link
Copy Markdown
Owner

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

Comment thread lib/litestream.rb Outdated
Comment thread lib/litestream.rb Outdated
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

rossta commented Sep 7, 2024

Copy link
Copy Markdown
Contributor Author

Sounds good, updated the PR with the requested changes.

@rossta rossta requested a review from fractaledmind October 2, 2024 13:11

@fractaledmind fractaledmind left a comment

Copy link
Copy Markdown
Owner

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
@fractaledmind

Copy link
Copy Markdown
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