Change Pre/Post KDC jobs to scripts

This commit is contained in:
niten 2024-01-13 10:16:16 -08:00
parent ace843b59d
commit 083defd692
1 changed files with 2 additions and 2 deletions

View File

@ -332,7 +332,7 @@ let
SecureBits = "keep-caps";
ReadWritePaths = [ "${dirOf cfg.kdc.database}" ];
StateDirectory = "hemidal-hpropd";
ExecStartPre =
ExecStartPre = pkgs.writeShellScript "heimdal-prepare-db.sh"
"cp ${cfg.kdc.database} $STATE_DIRECTORY/realm.db";
ExecStart = let
startScript = pkgs.writeShellScript "launch-heimdal-hpropd.sh"
@ -342,7 +342,7 @@ let
"--keytab=${cfg.kdc.secondary.keytabs.hpropd}"
]);
in "${startScript}";
ExecStartPost = ''
ExecStartPost = pkgs.writeShellScript "heimdal-restore-db.sh" ''
chown ${cfg.user}:${cfg.group} $STATE_DIRECTORY/realm.db
mv $STATE_DIRECTORY/realm.db ${cfg.kdc.database}
'';