Create Mono systemd service
This commit is contained in:
parent
db996d5cd5
commit
6315ab62af
|
@ -96,4 +96,26 @@
|
||||||
host all all ::1/128 trust
|
host all all ::1/128 trust
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Run Mono server
|
||||||
|
systemd.services.mono-server = {
|
||||||
|
description = "Mono server to run ASP .NET applications";
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
path = with pkgs; [ mono6 ];
|
||||||
|
script = ''
|
||||||
|
lockfile=/tmp/mono-service
|
||||||
|
${pkgs.mono6}/bin/mono-service -d:/vault/backups/frontend/inetpub/wwwroot/gcw -l:$lockfile
|
||||||
|
${pkgs.mono6}/bin/mono-service -d:/vault/backups/frontend/inetpub/wwwroot/few -l:$lockfile
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
RemainAfterExit = "yes";
|
||||||
|
User = "nginx";
|
||||||
|
Group = "nginx";
|
||||||
|
ExecStop = ''
|
||||||
|
kill `cat $lockfile`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
before = [ "nginx.service" ];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue