Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

How to controll the path and permission of '/tmp/sigdump-[0-9]+.log' files at the systemd shutdown. #607

Open
kuzukami opened this issue Jan 29, 2019 · 1 comment

Comments

@kuzukami
Copy link

kuzukami commented Jan 29, 2019

I want to fasten permission of files to ensure system security from the CIS view point.

In my setup td-agent 1.3.3 of CentOS7, '/tmp/sigdump-[0-9]+.log' are unexpectedly dumped on every shudown of systemd td-agentd service.
Furthermore, the almost fully opened permission of sigdump files (666 on my environment) cannot be controlled by either the 'UMask' setting or the ' file_permission' setting of configuration file. (relation? : fluent/fluentd#1152 )

As far as I read the fluentd document, the sigdump files are written (only?) if the fluentd receives the SIGCONT signal.
If the implementation of the sigdump behavior has no bug, the descriptions below could be appended in the document.

  1. the event of dumping sigdump in the standard setup of td-agent
  2. how to control the path of sigdump file. env SIGDUMP_PATH? (https://github.com/frsyuki/sigdump/blob/master/lib/sigdump.rb')
  3. how to control the permission of sigdump file. ( I cannot found the solution. )
  4. how to remove or suppress the sigdump files
@fujimotos
Copy link
Member

As a point of clarification, td-agent is not really supposed to create a dump file
on every shutdown; If your td-agent is keep receiving SIGCONT on shutdown,
there is probably something wrong with the systemd configuration.

  1. how to control the path of sigdump file. env SIGDUMP_PATH?

Yes. You should be able to change the output path by setting the environment
variable SIGDUMP_PATH.

  1. how to control the permission of sigdump file.

Right now there is no way to change it. We'll need to submit a patch to frsyuki/sigdump
to add the feature.

  1. how to remove or suppress the sigdump files

I think you can either remap the signal to something not used (i.e. SIGUSR2), or set SIGDUMP_PATH to - (which means "output the dump to stdout").

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants