From 69bbccdeed216b30272e1e8a8a049987db44c6be Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 15 Jan 2019 11:05:28 +0100 Subject: SatoshiPay: init replicaset at startup --- modules/satoshipay.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'modules') diff --git a/modules/satoshipay.nix b/modules/satoshipay.nix index 46cccc7..5198cc1 100644 --- a/modules/satoshipay.nix +++ b/modules/satoshipay.nix @@ -46,6 +46,17 @@ OnActiveSec = "1 min"; }; }; + systemd.services.mongodb-init = { + description = "Init mongodb replicaset"; + requires = [ "mongodb.service" ]; + script = "${pkgs.mongodb}/bin/mongo --eval 'rs.initiate()'"; + }; + systemd.timers.mongodb-init = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "2 min"; + }; + }; services.redis = { enable = true; -- cgit 1.4.1