Skip to content

Commit 39217f4

Browse files
authored
Merge pull request #861 from taketo1113/fix-error-handle-crontab-output
Handle crontab output to prevent SIGPIPE when running on CentOS Stream 10
2 parents 17e9697 + 3747131 commit 39217f4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/whenever/command_line.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def write_crontab(contents)
7878
IO.popen(command.join(' '), 'r+') do |crontab|
7979
crontab.write(contents)
8080
crontab.close_write
81+
stdout = crontab.read
82+
puts stdout unless stdout == ''
8183
end
8284

8385
success = $?.exitstatus.zero?

0 commit comments

Comments
 (0)