Perform hpropd merge outside of main dir
This commit is contained in:
parent
2a27c0f7b1
commit
e8a191908e
|
@ -331,16 +331,21 @@ let
|
||||||
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||||
SecureBits = "keep-caps";
|
SecureBits = "keep-caps";
|
||||||
ReadWritePaths = [ "${dirOf cfg.kdc.database}" ];
|
ReadWritePaths = [ "${dirOf cfg.kdc.database}" ];
|
||||||
|
StateDirectory = "hemidal-hpropd";
|
||||||
|
ExecStartPre =
|
||||||
|
"cp ${cfg.kdc.database} $STATE_DIRECTORY/realm.db";
|
||||||
ExecStart = let
|
ExecStart = let
|
||||||
startScript = pkgs.writeShellScript "launch-heimdal-hpropd.sh"
|
startScript = pkgs.writeShellScript "launch-heimdal-hpropd.sh"
|
||||||
(concatStringsSep " " [
|
(concatStringsSep " " [
|
||||||
"${pkgs.heimdal}/libexec/heimdal/hpropd"
|
"${pkgs.heimdal}/libexec/heimdal/hpropd"
|
||||||
"--database=sqlite:${cfg.kdc.database}"
|
"--database=sqlite:$STATE_DIRECTORY/realm.db"
|
||||||
"--keytab=${cfg.kdc.secondary.keytabs.hpropd}"
|
"--keytab=${cfg.kdc.secondary.keytabs.hpropd}"
|
||||||
]);
|
]);
|
||||||
in "${startScript}";
|
in "${startScript}";
|
||||||
ExecStartPost =
|
ExecStartPost = ''
|
||||||
"chown ${cfg.user}:${cfg.group} ${cfg.kdc.database}";
|
chown ${cfg.user}:${cfg.group} $STATE_DIRECTORY/realm.db
|
||||||
|
mv $STATE_DIRECTORY/realm.db ${cfg.kdc.database}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
unitConfig.ConditionPathExists =
|
unitConfig.ConditionPathExists =
|
||||||
[ cfg.kdc.database cfg.kdc.secondary.keytabs.hpropd ];
|
[ cfg.kdc.database cfg.kdc.secondary.keytabs.hpropd ];
|
||||||
|
|
Loading…
Reference in New Issue