Skip to content

Prevent subprocesses from trying to delete PID file#1836

Merged
albertomn86 merged 2 commits into3.7from
3.7-fix-subprocess-exit
Nov 8, 2018
Merged

Prevent subprocesses from trying to delete PID file#1836
albertomn86 merged 2 commits into3.7from
3.7-fix-subprocess-exit

Conversation

@vikman90
Copy link
Copy Markdown
Member

@vikman90 vikman90 commented Nov 8, 2018

This PR aims to fix this error:

wazuh-modulesd: ERROR: Couldn't delete PID file.

Daemons register a trigger to clean up their PID file before exiting (with atexit()). When a process is forked, it inherits its parent's functions. If a module fails to execute an external program after forking, the child process exits as a wazuh-modulesd process, this makes the process delete its PID file, but, since it's a subprocess, there is no PID file for it.

@vikman90 vikman90 added the type/bug Something isn't working label Nov 8, 2018
@vikman90 vikman90 requested a review from albertomn86 November 8, 2018 15:41
@albertomn86 albertomn86 merged commit 2b11ec1 into 3.7 Nov 8, 2018
@albertomn86 albertomn86 deleted the 3.7-fix-subprocess-exit branch November 8, 2018 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants