The automatically generated file may be unreadable due to umask. Change the permission to the required permission when creating.
Signed-off-by: Wu Zhende wuzhende666@163.com --- providers/docker/docker.rb | 1 + providers/multi-qemu | 1 + 2 files changed, 2 insertions(+)
diff --git a/providers/docker/docker.rb b/providers/docker/docker.rb index 56c9754..28ed29b 100755 --- a/providers/docker/docker.rb +++ b/providers/docker/docker.rb @@ -96,6 +96,7 @@ end def record_start_log(log_file, hash: {}) start_time = Time.new File.open(log_file, 'w') do |f| + f.chmod(0664) # fluentd refresh time is 1s # let fluentd to monitor this file first sleep(2) diff --git a/providers/multi-qemu b/providers/multi-qemu index c729c8e..1f945e6 100755 --- a/providers/multi-qemu +++ b/providers/multi-qemu @@ -53,6 +53,7 @@ def record_runtime_log(hostname, start_time: Time.new, is_start: true) log_file = "#{LOG_DIR}/#{hostname}" if is_start File.open(log_file, 'w') do |f| + f.chmod(0664) # fluentd refresh time is 1s # let fluentd to monitor this file first sleep(2)
Have you considered umask?
On Tue, Feb 09, 2021 at 04:38:52PM +0800, Wu Zhende wrote:
The automatically generated file may be unreadable due to umask. Change the permission to the required permission when creating.
Signed-off-by: Wu Zhende wuzhende666@163.com
providers/docker/docker.rb | 1 + providers/multi-qemu | 1 + 2 files changed, 2 insertions(+)
diff --git a/providers/docker/docker.rb b/providers/docker/docker.rb index 56c9754..28ed29b 100755 --- a/providers/docker/docker.rb +++ b/providers/docker/docker.rb @@ -96,6 +96,7 @@ end def record_start_log(log_file, hash: {}) start_time = Time.new File.open(log_file, 'w') do |f|
- f.chmod(0664) # fluentd refresh time is 1s # let fluentd to monitor this file first sleep(2)
diff --git a/providers/multi-qemu b/providers/multi-qemu index c729c8e..1f945e6 100755 --- a/providers/multi-qemu +++ b/providers/multi-qemu @@ -53,6 +53,7 @@ def record_runtime_log(hostname, start_time: Time.new, is_start: true) log_file = "#{LOG_DIR}/#{hostname}" if is_start File.open(log_file, 'w') do |f|
f.chmod(0664) # fluentd refresh time is 1s # let fluentd to monitor this file first sleep(2)
-- 2.23.0