-
Notifications
You must be signed in to change notification settings - Fork 22
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
systemd rsyslog service does not create PID file, that is used by logrotate scripts for SIGHUP #79
Comments
systemd script is inside rsyslog source, here is the PR: rsyslog/rsyslog#2739 |
This is a deliberate change that was just made at the request of the
maintainers.
|
@davidelang How are logrotate scripts supposed to send SIGHUP then? |
<sarcasam> everything needs to go through systemd </sarcasam>
I generally have used killall -HUP rsyslogd instead of the PID file, but I
haven't looked at what the distros are doing instead now.
|
@davidelang Here is what stock rsyslog in Ubuntu Xenial do:
I suggest to have PID file for interaction with rsyslog process in upstream. It won't hurt anybody. Now if you install rsyslog from ppa:adiscon/v8-stable on Ubuntu Xenial, logrotate is broken. |
We have just published a new revision of the packages. The new ones are now creating the pid file again on service startup. This should also solve the logrotate issue. |
Why not |
There was a lot of complaints on the rsyslog mailing list (see archive) that other programs need the pid file as well. |
pid files are not needed under systemd and should be avoided if possible. The official Debian package does not need a pid file and uses |
@mbiebl |
How so? |
My mistake, files rotated externally do not need it. OK, then software writing to syslog, something like this:
|
Using |
We had a release that disabled the pid file by default and ran into numerous
problem reports as a result.
As a result, I believe that we should create the pid file by default. If a
distro doesn't want the pid file to exist, we provide the option for you to
disable it.
David Lang
|
@davidelang Can you point to such reports? |
I'm asking because Debian is a rather conservative distro and I have the pid file disabled there for over a year now without a single bug report. |
I am not saying to use it in new configuration, I am saying there are a lot of productions systems using this already, together with official rsyslog packages from ppa, and people won't be happy to suddenly get broken system. Or upgrade to new distro version, that got rid of pid file, and suddenly stumble over broken configuration. Again, you say it's reliable? What if rsyslog launches additional processes, with Backward compatibility is important, system core software should keep it as long as possible. |
If you use |
Really, pid files are a terrible idea. The less there are of them, the better. |
That's the point, this processes should not get the signal, they might do unexpected things. Signal is for the main process only.
It's called backward compatibility, it should be kept as long as possible. |
If you want to send a signal to the main process only, that is easily doable with systemctl.
I don't agree. Sometimes bad practices should not be prolonged unnecessarily. |
On Mon, 29 Apr 2019, Michael Biebl wrote:
I'm asking because Debian is a rather conservative distro and I have the pid
file disabled there for over a year now without a single bug report.
note that not everyone uses the latest rsyslog build on the latest versions of
the distros.
I would have to go back through the mailing list to see the bug reports, but
there were a bunch of them, which is why we reverted back to creating the PID
file by default.
not all distros use systemd (OpenWRT is a significant one that doesn't)
We really don't like to break backwards compatibility, and only do it if there
is a really important reason. I don't see a compelling reason here.
David Lang
|
I'd be honestly interested in such bug reports, because the only breakage I'm aware of is in the Ubuntu rsyslog package. They messed up the rsyslog package by not updating the logrotate script when they stopped creating a PID file.
Irrelevant here as this change discussed here is specifically for distros using systemd. |
On Mon, 29 Apr 2019, Michael Biebl wrote:
> not all distros use systemd (OpenWRT is a significant one that doesn't)
Irrelevant here as this change discussed here is specifically for distros using systemd.
How is this not relevant? you are asking us to change the default for compiling
rsyslog, aren't you? A change of the default will affect all distros. We have
different configs for compiling the packages, but not different defaults in what
the options do.
I also note that if someone has a logrotate config that they have brought
forward from older versions of Debian, then it will still depend on the pid
file, even if Debian how offers a different way to do signal the program.
Other than your personal dislike of pid files, what is the harm in continuing to
create one? It doesn't break your new way of signaling the program, you have a
config option to turn it off if you don't want it.
David Lang
|
This here is for rsyslog-pkg-ubuntu, i.e. rsyslog packages that are provided by Adiscon for Ubuntu. |
to be specific: The rsylogd.pid part of that patch. |
This will break at least one thing in my production configuration, I posted simplified version in upper comments. It will probably break somebody's else configuration. And it will even break the ppa rsyslog package itself, because it comes with logrotate config using Oh yeah, and it will make harder for people to maintain configurations working both on Linux and *BSD, which does not use systemd. And I completely miss the whole point of making this calamity. |
If you don't know why pid files are bad, I suggest you read up on that topic. |
On Mon, 29 Apr 2019, Michael Biebl wrote:
If you don't know why pid files are bad, I suggest you read up on that topic.
Let me re-phrase the question.
Why are pid files so bad that it's worth breaking anyone's systems who are still
configured to use them?
I'm not calling for eliminating of the ability to not use the pid file, I am
just talking about the ability to use the pid file in addition to your other
methods.
David Lang
|
I'd argue that the upstream defaults should be sane. If there are user setups which need a pid file for whatever reason, they are free to configure their system this way. |
(or better, update their configuration to not rely on pid files) |
I don't like to go into systemd politics. This here is the repository Adiscon maintains primarily for it's customers - those folks that pay to make it happen. So in contrast to the main project we have a very clear focus here: whoever pays decides how things should be. Our customers have clearly told us they want the pid file. And so the patch will remain. I do not say this is the best way to do it. I say this is the way folks pay us to do it. |
I should also mention that I personally tend to say that "no pid file" is a good idea. But from a pragmatical PoV I really don't care that much and avoid hassle if possible. |
Sorry for adding any noise, but I had to use rsyslog's "debug on demand" feature today and noticed that the docs reference use of a pid file to determine the current process id: Example:
Intent of this post: Note that if the PID files are not created by default then that example would need to be updated to use a different approach of retrieving the PID. |
The use of pidfiles seems to be one which causes much debate [1] and debain buster no longer creates a pidfile for rsyslog so the tests in this role which rely on it are broken. Given that systemd now knows the process pid and more distros are likley to drop the use of the pidfile, and also that the rsyslog functionality in OSA is largely replaced with systemd journal remote forwarding, we can remove these tests that break without a pidfile. [1] rsyslog/rsyslog-pkg-ubuntu#79 Change-Id: Ia2be525c75fb8bbc549cbc3aa53b3c0db05002fa
* Update openstack-ansible-rsyslog_server from branch 'master' - Drop tests that rely on the presence of a pidfile The use of pidfiles seems to be one which causes much debate [1] and debain buster no longer creates a pidfile for rsyslog so the tests in this role which rely on it are broken. Given that systemd now knows the process pid and more distros are likley to drop the use of the pidfile, and also that the rsyslog functionality in OSA is largely replaced with systemd journal remote forwarding, we can remove these tests that break without a pidfile. [1] rsyslog/rsyslog-pkg-ubuntu#79 Change-Id: Ia2be525c75fb8bbc549cbc3aa53b3c0db05002fa
OS: Ubuntu 16.04 Xenial
rsyslog package:
8.34.0-0adiscon2xenial1
fromppa:adiscon/v8-stable
Logrotate scripts often use
invoke-rc.d rsyslog rotate
to tell rsyslog to close all open files./etc/init.d/rsyslog
script expects PID file to be/var/run/rsyslogd.pid
.Systemd script launches rsyslog with this arguments:
ExecStart=/usr/sbin/rsyslogd -n -iNONE
. PID file is not created. Logrotate is broken.To fix this, systemd rsyslog script should launch it like that:
ExecStart=/usr/sbin/rsyslogd -n -i/var/run/rsyslogd.pid
The text was updated successfully, but these errors were encountered: