nixos/unit: update preStart script

This commit is contained in:
Izorkin 2019-12-10 09:49:58 +03:00
parent 7443d9dfd4
commit e1e0059667

View file

@ -93,7 +93,7 @@ in {
wantedBy = [ "multi-user.target" ];
path = with pkgs; [ curl ];
preStart = ''
test -f '/run/unit/control.unit.sock' || rm -f '/run/unit/control.unit.sock'
test -f '${cfg.stateDir}/conf.json' || rm -f '${cfg.stateDir}/conf.json'
'';
postStart = ''
curl -X PUT --data-binary '@${configFile}' --unix-socket '/run/unit/control.unit.sock' 'http://localhost/config'