about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2019-03-04 12:23:45 +0800
committerGitHub <noreply@github.com>2019-03-04 12:23:45 +0800
commit011fe4a24618ef83a678e817ac9e87e64b2f8ba9 (patch)
treee7913f17def699afdaf5849909a81dfd295e6fc5 /nixos
parent7874ca5b610e66d99d0989956f9e69d589f16315 (diff)
parent0e40b7bfc2004a5448aa3883a528e2b381d9d877 (diff)
downloadnixlib-011fe4a24618ef83a678e817ac9e87e64b2f8ba9.tar
nixlib-011fe4a24618ef83a678e817ac9e87e64b2f8ba9.tar.gz
nixlib-011fe4a24618ef83a678e817ac9e87e64b2f8ba9.tar.bz2
nixlib-011fe4a24618ef83a678e817ac9e87e64b2f8ba9.tar.lz
nixlib-011fe4a24618ef83a678e817ac9e87e64b2f8ba9.tar.xz
nixlib-011fe4a24618ef83a678e817ac9e87e64b2f8ba9.tar.zst
nixlib-011fe4a24618ef83a678e817ac9e87e64b2f8ba9.zip
Merge pull request #56571 from peterhoeg/u/mqtt
mosquitto: 1.5.5 -> 1.5.8
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/mosquitto.nix9
1 files changed, 4 insertions, 5 deletions
diff --git a/nixos/modules/services/networking/mosquitto.nix b/nixos/modules/services/networking/mosquitto.nix
index 332dc541345e..9974cbd89d1e 100644
--- a/nixos/modules/services/networking/mosquitto.nix
+++ b/nixos/modules/services/networking/mosquitto.nix
@@ -17,7 +17,6 @@ let
   '';
 
   mosquittoConf = pkgs.writeText "mosquitto.conf" ''
-    pid_file /run/mosquitto/pid
     acl_file ${aclFile}
     persistence true
     allow_anonymous ${boolToString cfg.allowAnonymous}
@@ -196,15 +195,15 @@ in
       wantedBy = [ "multi-user.target" ];
       after = [ "network.target" ];
       serviceConfig = {
-        Type = "forking";
+        Type = "notify";
+        NotifyAccess = "main";
         User = "mosquitto";
         Group = "mosquitto";
         RuntimeDirectory = "mosquitto";
         WorkingDirectory = cfg.dataDir;
         Restart = "on-failure";
-        ExecStart = "${pkgs.mosquitto}/bin/mosquitto -c ${mosquittoConf} -d";
+        ExecStart = "${pkgs.mosquitto}/bin/mosquitto -c ${mosquittoConf}";
         ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
-        PIDFile = "/run/mosquitto/pid";
       };
       preStart = ''
         rm -f ${cfg.dataDir}/passwd
@@ -214,7 +213,7 @@ in
           if c.hashedPassword != null then
             "echo '${n}:${c.hashedPassword}' >> ${cfg.dataDir}/passwd"
           else optionalString (c.password != null)
-            "${pkgs.mosquitto}/bin/mosquitto_passwd -b ${cfg.dataDir}/passwd ${n} ${c.password}"
+            "${pkgs.mosquitto}/bin/mosquitto_passwd -b ${cfg.dataDir}/passwd ${n} '${c.password}'"
         ) cfg.users);
     };