From 82dbcd50f000b9559b206c49739ec5be368f18aa Mon Sep 17 00:00:00 2001 From: James Herdman Date: Sun, 7 Sep 2025 15:57:13 -0400 Subject: [PATCH] fix: Improve compatibility with Alpine Linux Alpine's `ps` doesn't support the `-x` command. SO suggests `-ef` is more than sufficient as a replacement. --- README.md | 5 +++++ lib/litestream.rb | 2 +- test/test_litestream.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e5c3056..1143163 100644 --- a/README.md +++ b/README.md @@ -523,6 +523,11 @@ time=YYYY-MM-DDTHH:MM:SS level=INFO msg="initialized db" path=/path/to/your/app/ time=YYYY-MM-DDTHH:MM:SS level=INFO msg="replicating to" name=s3 type=s3 sync-interval=1s bucket=mybkt path="" region=us-east-1 endpoint=http://localhost:9000 ``` +### Troubleshooting + +Some version of Linux don't install `ps`, you may need to install it in order to +leverage the Rails engine. + ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. diff --git a/lib/litestream.rb b/lib/litestream.rb index 159faa9..6c4b7a0 100644 --- a/lib/litestream.rb +++ b/lib/litestream.rb @@ -164,7 +164,7 @@ def systemctl_info end def process_info - litestream_replicate_ps = `ps -ax | grep litestream | grep replicate` + litestream_replicate_ps = `ps -ef | grep litestream | grep replicate` exit_code = $?.exitstatus return unless exit_code.zero? diff --git a/test/test_litestream.rb b/test/test_litestream.rb index 5c1f41d..abb01c0 100644 --- a/test/test_litestream.rb +++ b/test/test_litestream.rb @@ -68,7 +68,7 @@ def test_replicate_process_ps stubbed_backticks = proc do |arg| case arg - when "ps -ax | grep litestream | grep replicate" + when "ps -ef | grep litestream | grep replicate" stubbed_ps_list when %(ps -o "state,lstart" 40364) stubbed_ps_status