Skip to content

Commit 285e7b1

Browse files
committed
Fix litestream showing as "not running" in Docker
When deploying litestream-ruby via Kamal and Docker, the dashboard shows the process as not running. Using the "x" option for "ps" seems to solve this. As per ps man page: x Lift the BSD-style "must have a tty" restriction, which is imposed upon the set of all processes when some BSD-style (without "-") options are used or when the ps personality setting is BSD-like. The set of processes selected in this manner is in addition to the set of processes selected by other means. An alternate description is that this option causes ps to list all processes owned by you (same EUID as ps), or to list all processes when used together with the a option. Resolves: #43
1 parent c1c666a commit 285e7b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/litestream.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def replicate_process
115115
end
116116
end
117117
else
118-
litestream_replicate_ps = `ps -a | grep litestream | grep replicate`.chomp
118+
litestream_replicate_ps = `ps -ax | grep litestream | grep replicate`.chomp
119119
litestream_replicate_ps.split("\n").each do |line|
120120
next unless line.include?("litestream replicate")
121121
pid, * = line.split(" ")

test/test_litestream.rb

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

4242
stubbed_backticks = proc do |arg|
4343
case arg
44-
when "ps -a | grep litestream | grep replicate"
44+
when "ps -ax | grep litestream | grep replicate"
4545
stubbed_ps_list
4646
when %(ps -o "state,lstart" 40364)
4747
stubbed_ps_status

0 commit comments

Comments
 (0)