l 2 websites domsen: add phpfpm restarter

This commit is contained in:
lassulus 2017-03-25 22:49:50 +01:00
parent 6e10766e9c
commit 2ed6a854ed

View File

@ -21,6 +21,22 @@ let
exec ${pkgs.msmtp}/bin/msmtp --read-envelope-from -C ${msmtprc} "$@" exec ${pkgs.msmtp}/bin/msmtp --read-envelope-from -C ${msmtprc} "$@"
''; '';
restartPhpfpm_o.ubikmedia = pkgs.writeDash "restartPhpfpm_o.ubikmedia.org" ''
${pkgs.systemd}/bin/systemctl restart phpfpm-o.ubikmedia.de.service
'';
restartPhpfpm_o.ubikmedia_wrapper = pkgs.writeDashBin "restartPhpfpm_o.ubikmedia" ''
/run/wrappers/bin/sudo ${restartPhpfpm_o.ubikmedia}
'';
restartPhpfpm_ubikmedia = pkgs.writeDash "restartPhpfpm_ubikmedia.org" ''
${pkgs.systemd}/bin/systemctl restart phpfpm-ubikmedia.de.service
'';
restartPhpfpm_ubikmedia_wrapper = pkgs.writeDashBin "restartPhpfpm_ubikmedia" ''
/run/wrappers/bin/sudo ${restartPhpfpm_ubikmedia}
'';
in { in {
imports = [ imports = [
./sqlBackup.nix ./sqlBackup.nix
@ -162,5 +178,17 @@ in {
useDefaultShell = true; useDefaultShell = true;
createHome = true; createHome = true;
}; };
#sudo restart wrappers
security.sudo.extraConfig = ''
domsen ALL= (root) NOPASSWD: ${restartPhpfpm_o.ubikmedia}
domsen ALL= (root) NOPASSWD: ${restartPhpfpm_ubikmedia}
'';
krebs.per-user.domsen.packages = [
restartPhpfpm_ubikmedia_wrapper
restartPhpfpm_o.ubikmedia_wrapper
];
} }