git.iko.soy/typeable/nixpkgs
on master help sign in
glusterfs service: Add killMode and stopKillTimeout options
commite233a518bdd72ec2c8783faa6d8bddef1e47c0bd authorNiklas Hambüchen <mail@nh2.me> dateMon 15 May 2017, 03:03 (10 years ago) parentbd54b72
1 file changed+34−1
nixos/modules/services/network-filesystems/glusterfs.nix+34−1
nixos/modules/services/network-filesystems/glusterfs.nix+34−1
@@ -60,6 +60,38 @@ in
6060 default = true;
6161 };
6262
63+ killMode = mkOption {
64+ type = types.enum ["control-group" "process" "mixed" "none"];
65+ description = ''
66+ The systemd KillMode to use for glusterd.
67+
68+ glusterd spawns other daemons like gsyncd.
69+ If you want these to stop when glusterd is stopped (e.g. to ensure
70+ that NixOS config changes are reflected even for these sub-daemons),
71+ set this to 'control-group'.
72+ If however you want running volume processes (glusterfsd) and thus
73+ gluster mounts not be interrupted when glusterd is restarted
74+ (for example, when you want to restart them manually at a later time),
75+ set this to 'process'.
76+ '';
77+ default = "process";
78+ };
79+
80+ stopKillTimeout = mkOption {
81+ type = types.str;
82+ description = ''
83+ The systemd TimeoutStopSec to use.
84+
85+ After this time after having been asked to shut down, glusterd
86+ (and depending on the killMode setting also its child processes)
87+ are killed by systemd.
88+
89+ The default is set low because GlusterFS (as of 3.10) is known to
90+ not tell its children (like gsyncd) to terminate at all.
91+ '';
92+ default = "5s";
93+ };
94+
6395 extraFlags = mkOption {
6496 type = types.listOf types.str;
6597 description = "Extra flags passed to the GlusterFS daemon";
@@ -148,7 +180,8 @@ in
148180 PIDFile="/run/glusterd.pid";
149181 LimitNOFILE=65536;
150182 ExecStart="${glusterfs}/sbin/glusterd -p /run/glusterd.pid --log-level=${cfg.logLevel} ${toString cfg.extraFlags}";
151− KillMode="process";
183+ KillMode=cfg.killMode;
184+ TimeoutStopSec=cfg.stopKillTimeout;
152185 };
153186 };
154187