diff options
author | Niklas Hambüchen <mail@nh2.me> | 2017-05-15 03:03:13 +0200 |
---|---|---|
committer | Niklas Hambüchen <mail@nh2.me> | 2017-09-27 20:53:39 +0200 |
commit | e233a518bdd72ec2c8783faa6d8bddef1e47c0bd (patch) | |
tree | 09a9d1f38731ab4ae4d2c117052e8e5bcbeb3e80 /nixos/modules/services/network-filesystems | |
parent | bd54b72676893d1519b217b23b3b868c8421d04a (diff) | |
download | nixlib-e233a518bdd72ec2c8783faa6d8bddef1e47c0bd.tar nixlib-e233a518bdd72ec2c8783faa6d8bddef1e47c0bd.tar.gz nixlib-e233a518bdd72ec2c8783faa6d8bddef1e47c0bd.tar.bz2 nixlib-e233a518bdd72ec2c8783faa6d8bddef1e47c0bd.tar.lz nixlib-e233a518bdd72ec2c8783faa6d8bddef1e47c0bd.tar.xz nixlib-e233a518bdd72ec2c8783faa6d8bddef1e47c0bd.tar.zst nixlib-e233a518bdd72ec2c8783faa6d8bddef1e47c0bd.zip |
glusterfs service: Add killMode and stopKillTimeout options
Diffstat (limited to 'nixos/modules/services/network-filesystems')
-rw-r--r-- | nixos/modules/services/network-filesystems/glusterfs.nix | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/nixos/modules/services/network-filesystems/glusterfs.nix b/nixos/modules/services/network-filesystems/glusterfs.nix index a697bb25da51..f888ae36d98e 100644 --- a/nixos/modules/services/network-filesystems/glusterfs.nix +++ b/nixos/modules/services/network-filesystems/glusterfs.nix @@ -60,6 +60,38 @@ in default = true; }; + killMode = mkOption { + type = types.enum ["control-group" "process" "mixed" "none"]; + description = '' + The systemd KillMode to use for glusterd. + + glusterd spawns other daemons like gsyncd. + If you want these to stop when glusterd is stopped (e.g. to ensure + that NixOS config changes are reflected even for these sub-daemons), + set this to 'control-group'. + If however you want running volume processes (glusterfsd) and thus + gluster mounts not be interrupted when glusterd is restarted + (for example, when you want to restart them manually at a later time), + set this to 'process'. + ''; + default = "process"; + }; + + stopKillTimeout = mkOption { + type = types.str; + description = '' + The systemd TimeoutStopSec to use. + + After this time after having been asked to shut down, glusterd + (and depending on the killMode setting also its child processes) + are killed by systemd. + + The default is set low because GlusterFS (as of 3.10) is known to + not tell its children (like gsyncd) to terminate at all. + ''; + default = "5s"; + }; + extraFlags = mkOption { type = types.listOf types.str; description = "Extra flags passed to the GlusterFS daemon"; @@ -148,7 +180,8 @@ in PIDFile="/run/glusterd.pid"; LimitNOFILE=65536; ExecStart="${glusterfs}/sbin/glusterd -p /run/glusterd.pid --log-level=${cfg.logLevel} ${toString cfg.extraFlags}"; - KillMode="process"; + KillMode=cfg.killMode; + TimeoutStopSec=cfg.stopKillTimeout; }; }; |