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

syslog-ng: fix reload service #45078

Merged
merged 2 commits into from
Aug 16, 2018
Merged

Conversation

Izorkin
Copy link
Contributor

@Izorkin Izorkin commented Aug 15, 2018

Motivation for this change

Sorry, PR #45073 it`s wrong

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg GrahamcOfBorg added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Aug 15, 2018
@infinisil
Copy link
Member

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}`";
Copy link
Member

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)

Copy link
Contributor Author

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.

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 16, 2018

Updated PR and tested.

@@ -85,10 +85,11 @@ in {
after = [ "multi-user.target" ]; # makes sure hostname etc is set
serviceConfig = {
Type = "notify";
PIDFile = "${pidFile}";
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to PIDFile = pidFile;

@infinisil infinisil merged commit be34fdf into NixOS:master Aug 16, 2018
@infinisil
Copy link
Member

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

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 17, 2018

Already nothing can be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants