Merge pull request #298168 from ambroisie/improve-tandoor-recipes-manage
nixos/tandoor-recipes: improve manage script
This commit is contained in:
commit
63078e3468
|
@ -20,7 +20,10 @@ let
|
||||||
manage = pkgs.writeShellScript "manage" ''
|
manage = pkgs.writeShellScript "manage" ''
|
||||||
set -o allexport # Export the following env vars
|
set -o allexport # Export the following env vars
|
||||||
${lib.toShellVars env}
|
${lib.toShellVars env}
|
||||||
exec ${pkg}/bin/tandoor-recipes "$@"
|
eval "$(${config.systemd.package}/bin/systemctl show -pUID,GID,MainPID tandoor-recipes.service)"
|
||||||
|
exec ${pkgs.util-linux}/bin/nsenter \
|
||||||
|
-t $MainPID -m -S $UID -G $GID \
|
||||||
|
${pkg}/bin/tandoor-recipes "$@"
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -82,6 +85,7 @@ in
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
|
||||||
User = "tandoor_recipes";
|
User = "tandoor_recipes";
|
||||||
|
Group = "tandoor_recipes";
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
StateDirectory = "tandoor-recipes";
|
StateDirectory = "tandoor-recipes";
|
||||||
WorkingDirectory = "/var/lib/tandoor-recipes";
|
WorkingDirectory = "/var/lib/tandoor-recipes";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user