swarm-controller: chgrp the runtime dir in ExecStartPost, ExecStart's setup undid the ExecStartPre one
This commit is contained in:
parent
738dd1c95b
commit
a6147dc875
2 changed files with 8 additions and 7 deletions
|
|
@ -727,11 +727,12 @@ in
|
|||
# 0750 with the group set to `clientsGroup` below: only nginx and
|
||||
# root can reach the socket inside.
|
||||
RuntimeDirectoryMode = "0750";
|
||||
# systemd chowns the runtime directory to `User:Group` on every
|
||||
# start, and the daemon is not a member of `clientsGroup`, so it
|
||||
# cannot chgrp the directory itself. `+` runs this as root, after
|
||||
# that chown.
|
||||
ExecStartPre = "+${pkgs.coreutils}/bin/chgrp ${clientsGroup} ${builtins.dirOf deployCfg.swarm-controller.socketPath}";
|
||||
# systemd re-chowns the runtime directory to `User:Group` while
|
||||
# setting up every command, `ExecStart` included, so a chgrp in
|
||||
# `ExecStartPre` is undone. The daemon is not a member of
|
||||
# `clientsGroup` and cannot chgrp it itself; `+` runs this as root,
|
||||
# after the last chown.
|
||||
ExecStartPost = "+${pkgs.coreutils}/bin/chgrp ${clientsGroup} ${builtins.dirOf deployCfg.swarm-controller.socketPath}";
|
||||
# Preserved across restarts so the path never vanishes from under a
|
||||
# running nginx. The daemon unlinks a stale socket on start, which
|
||||
# is what makes preservation safe.
|
||||
|
|
|
|||
Loading…
Reference in a new issue