diff --git a/lib/flatware/cli.rb b/lib/flatware/cli.rb index 4dad80e..6ea47d1 100644 --- a/lib/flatware/cli.rb +++ b/lib/flatware/cli.rb @@ -55,7 +55,8 @@ def clear def start_sink(jobs:, workers:, formatter:) $0 = 'flatware sink' - Process.setpgrp + try_setpgrp + passed = Sink.start_server( jobs: jobs, formatter: Flatware::Broadcaster.new([formatter]), @@ -65,6 +66,12 @@ def start_sink(jobs:, workers:, formatter:) exit passed ? 0 : 1 end + def try_setpgrp + Process.setpgrp + rescue Errno::EPERM => e + Flatware.log 'continuing after: Process.setpgrp:', e.message + end + def workers options[:workers] end