Skip to content

Commit 82dbcd5

Browse files
committed
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.
1 parent fe20aa6 commit 82dbcd5

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,11 @@ time=YYYY-MM-DDTHH:MM:SS level=INFO msg="initialized db" path=/path/to/your/app/
523523
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
524524
```
525525

526+
### Troubleshooting
527+
528+
Some version of Linux don't install `ps`, you may need to install it in order to
529+
leverage the Rails engine.
530+
526531
## Development
527532

528533
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.

lib/litestream.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def systemctl_info
164164
end
165165

166166
def process_info
167-
litestream_replicate_ps = `ps -ax | grep litestream | grep replicate`
167+
litestream_replicate_ps = `ps -ef | grep litestream | grep replicate`
168168
exit_code = $?.exitstatus
169169
return unless exit_code.zero?
170170

test/test_litestream.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_replicate_process_ps
6868

6969
stubbed_backticks = proc do |arg|
7070
case arg
71-
when "ps -ax | grep litestream | grep replicate"
71+
when "ps -ef | grep litestream | grep replicate"
7272
stubbed_ps_list
7373
when %(ps -o "state,lstart" 40364)
7474
stubbed_ps_status

0 commit comments

Comments
 (0)