Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve protection against duplicate instances #3892

Open
davidelang opened this issue Oct 8, 2019 · 6 comments
Open

improve protection against duplicate instances #3892

davidelang opened this issue Oct 8, 2019 · 6 comments

Comments

@davidelang
Copy link
Contributor

currently when rsyslog starts, it checks to see if a pidfile exists, and if it exists, rsyslog refuses to start.

However, if rsyslog crashes or is killed with a -9, it does not have a chance to remove the pidfile and so a replacement cannot be started

As an enhancement, rather than just depending only on the existance of a pid file, rsyslog should look in the pid file and check to see if there is a process running with that pid (ideally if it's an rsyslog process, but at least that some process with that pid exists on the system), if there is no process with that pid, rsyslog should log a warning that there was a orphaned pid file and overwrite it.

@smowafy
Copy link

smowafy commented Oct 8, 2019

I'm interested in this issue, if it's possible I can take it over.

Disclaimer: This would be my first meaningful contribution in a C project, so in case I took it please excuse me in case I was a little slow on this one.

@davidelang
Copy link
Contributor Author

davidelang commented Oct 8, 2019 via email

@rgerhards
Copy link
Member

At least in theory, rsyslog should already do exactly that: https://github.com/rsyslog/rsyslog/blob/master/tools/rsyslogd.c#L326

Might it be that due to some SELinux or similar rsyslog has no permissions to send the signal to itself? Or Priv Drop? Not sure if we can come around this via a non-privileged interface.

@davidelang
Copy link
Contributor Author

davidelang commented Oct 9, 2019 via email

@rgerhards
Copy link
Member

rgerhards commented Oct 9, 2019 via email

@skupkosk
Copy link

skupkosk commented Oct 9, 2019 via email

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

No branches or pull requests

4 participants