about summary refs log tree commit diff
path: root/nixos/modules/services/logging
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2014-11-01 13:39:42 -0700
committerWilliam A. Kennington III <william@wkennington.com>2014-11-02 17:22:28 -0800
commit8e1072fd60f9dcf5eac0bb2d604258f121b658d8 (patch)
tree6121fd2a5b76f20b904e6e8d4fa5e3dee91d5520 /nixos/modules/services/logging
parent617cd15c8ed99651d80c3b01399201cdd981c302 (diff)
downloadnixlib-8e1072fd60f9dcf5eac0bb2d604258f121b658d8.tar
nixlib-8e1072fd60f9dcf5eac0bb2d604258f121b658d8.tar.gz
nixlib-8e1072fd60f9dcf5eac0bb2d604258f121b658d8.tar.bz2
nixlib-8e1072fd60f9dcf5eac0bb2d604258f121b658d8.tar.lz
nixlib-8e1072fd60f9dcf5eac0bb2d604258f121b658d8.tar.xz
nixlib-8e1072fd60f9dcf5eac0bb2d604258f121b658d8.tar.zst
nixlib-8e1072fd60f9dcf5eac0bb2d604258f121b658d8.zip
Revert "syslog-ng: Update from 3.5.6 to 3.6.1"
This reverts commit e2ada42623f26d51cf7d1253ac0700297e1a9b83.
Diffstat (limited to 'nixos/modules/services/logging')
-rw-r--r--nixos/modules/services/logging/syslog-ng.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/nixos/modules/services/logging/syslog-ng.nix b/nixos/modules/services/logging/syslog-ng.nix
index 2bf6d1ff7904..f3991a411ec4 100644
--- a/nixos/modules/services/logging/syslog-ng.nix
+++ b/nixos/modules/services/logging/syslog-ng.nix
@@ -43,6 +43,15 @@ in {
           The package providing syslog-ng binaries.
         '';
       };
+      listenToJournal = mkOption {
+        type = types.bool;
+        default = true;
+        description = ''
+          Whether syslog-ng should listen to the syslog socket used
+          by journald, and therefore receive all logs that journald
+          produces.
+        '';
+      };
       extraModulePaths = mkOption {
         type = types.listOf types.str;
         default = [];
@@ -65,7 +74,7 @@ in {
       configHeader = mkOption {
         type = types.lines;
         default = ''
-          @version: 3.6
+          @version: 3.5
           @include "scl.conf"
         '';
         description = ''
@@ -77,13 +86,18 @@ in {
   };
 
   config = mkIf cfg.enable {
+    systemd.sockets.syslog = mkIf cfg.listenToJournal {
+      wantedBy = [ "sockets.target" ];
+      socketConfig.Service = "syslog-ng.service";
+    };
     systemd.services.syslog-ng = {
       description = "syslog-ng daemon";
       preStart = "mkdir -p /{var,run}/syslog-ng";
-      wantedBy = [ "multi-user.target" ];
+      wantedBy = optional (!cfg.listenToJournal) "multi-user.target";
       after = [ "multi-user.target" ]; # makes sure hostname etc is set
       serviceConfig = {
         Type = "notify";
+        Sockets = if cfg.listenToJournal then "syslog.socket" else null;
         StandardOutput = "null";
         Restart = "on-failure";
         ExecStart = "${cfg.package}/sbin/syslog-ng ${concatStringsSep " " syslogngOptions}";