From 5481831263b6dde4a33d8fa6f20dff38646a1949 Mon Sep 17 00:00:00 2001 From: Alexander Ried Date: Mon, 12 Sep 2016 16:34:10 +0200 Subject: [PATCH] misc.etcd: get closer to upstream service definition taken from https://github.com/coreos/etcd/blob/master/contrib/systemd/etcd.service I intentionally kept "After = network.target" because I think it's missing upstream (https://github.com/coreos/etcd/pull/6388) --- nixos/modules/services/misc/etcd.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/misc/etcd.nix b/nixos/modules/services/misc/etcd.nix index d30cc5fd7e8..1de02d76ba0 100644 --- a/nixos/modules/services/misc/etcd.nix +++ b/nixos/modules/services/misc/etcd.nix @@ -143,9 +143,9 @@ in { config = mkIf cfg.enable { systemd.services.etcd = { - description = "Etcd Daemon"; + description = "etcd key-value store"; wantedBy = [ "multi-user.target" ]; - after = [ "network-interfaces.target" ]; + after = [ "network.target" ]; environment = (filterAttrs (n: v: v != null) { ETCD_NAME = cfg.name; @@ -168,12 +168,18 @@ in { ETCD_INITIAL_CLUSTER_TOKEN = cfg.initialClusterToken; }) // (mapAttrs' (n: v: nameValuePair "ETCD_${n}" v) cfg.extraConf); + unitConfig = { + Documentation = "https://github.com/coreos/etcd"; + }; + serviceConfig = { Type = "notify"; ExecStart = "${pkgs.etcd.bin}/bin/etcd"; User = "etcd"; PermissionsStartOnly = true; + LimitNOFILE = 40000; }; + preStart = '' mkdir -m 0700 -p ${cfg.dataDir} if [ "$(id -u)" = 0 ]; then chown etcd ${cfg.dataDir}; fi