-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
syslog-ng: fix reload service #45078
Conversation
1806d53
to
300fe1c
Compare
Not sure how I didn't spot that, sorry for that. But you should also test your PR's properly before submitting them. These checkmarks are there for a reason. |
@@ -88,7 +88,7 @@ in { | |||
StandardOutput = "null"; | |||
Restart = "on-failure"; | |||
ExecStart = "${cfg.package}/sbin/syslog-ng ${concatStringsSep " " syslogngOptions}"; | |||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP ${pidFile}"; | |||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP `${pkgs.coreutils}/bin/cat ${pidFile}`"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
{
PIDFile = pidFile;
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
}
instead
(And make sure to test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both options worked for me.
Updated PR and tested. |
@@ -85,10 +85,11 @@ in { | |||
after = [ "multi-user.target" ]; # makes sure hostname etc is set | |||
serviceConfig = { | |||
Type = "notify"; | |||
PIDFile = "${pidFile}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is pidfile required for this to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked without PIDFile = "${pidFile}"; Remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
systemd does some auto-detection for the main pid through forks, but I think since we have the pidfile already, we might as well pass it to be sure.
Is there a problem with PIDFile = pidFile;
? I'm pretty sure the "${..}
isn't needed, which is why I proposed this code in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variant ExecReload = "${pkgs.coreutils}/bin/kill -HUP ${pkgs.coreutils}/bin/cat ${pidFile}
"; fully working, for the first time and made such a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, use this:
{
PIDFile = pidFile;
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
}
As I said initially
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to PIDFile = pidFile;
fa79fbc
to
e4f4589
Compare
Whoops I or you should have squashed the commits, I didn't notice. That's 2 (minor) mess ups of me in the last 24 hours :o |
Already nothing can be done? |
Motivation for this change
Sorry, PR #45073 it`s wrong
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)