mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
httpd.nix: Support non-root operation
This commit is contained in:
parent
2b0aea1793
commit
886b9e27a6
1 changed files with 3 additions and 2 deletions
|
@ -628,10 +628,10 @@ in
|
||||||
preStart =
|
preStart =
|
||||||
''
|
''
|
||||||
mkdir -m 0750 -p ${mainCfg.stateDir}
|
mkdir -m 0750 -p ${mainCfg.stateDir}
|
||||||
chown root.${mainCfg.group} ${mainCfg.stateDir}
|
[ $(id -u) != 0 ] || chown root.${mainCfg.group} ${mainCfg.stateDir}
|
||||||
${optionalString version24 ''
|
${optionalString version24 ''
|
||||||
mkdir -m 0750 -p "${mainCfg.stateDir}/runtime"
|
mkdir -m 0750 -p "${mainCfg.stateDir}/runtime"
|
||||||
chown root.${mainCfg.group} "${mainCfg.stateDir}/runtime"
|
[ $(id -u) != 0 ] || chown root.${mainCfg.group} "${mainCfg.stateDir}/runtime"
|
||||||
''}
|
''}
|
||||||
mkdir -m 0700 -p ${mainCfg.logDir}
|
mkdir -m 0700 -p ${mainCfg.logDir}
|
||||||
|
|
||||||
|
@ -659,6 +659,7 @@ in
|
||||||
serviceConfig.ExecStart = "@${httpd}/bin/httpd httpd -f ${httpdConf}";
|
serviceConfig.ExecStart = "@${httpd}/bin/httpd httpd -f ${httpdConf}";
|
||||||
serviceConfig.ExecStop = "${httpd}/bin/httpd -f ${httpdConf} -k graceful-stop";
|
serviceConfig.ExecStop = "${httpd}/bin/httpd -f ${httpdConf} -k graceful-stop";
|
||||||
serviceConfig.Type = "forking";
|
serviceConfig.Type = "forking";
|
||||||
|
serviceConfig.PIDFile = "${mainCfg.stateDir}/httpd.pid";
|
||||||
serviceConfig.Restart = "always";
|
serviceConfig.Restart = "always";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue