Compare commits
3 commits
8b7b4955df
...
1660118c2e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1660118c2e | ||
|
|
f8e585c83f | ||
|
|
8453ab9ae9 |
1 changed files with 6 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ in {
|
|||
systemd.services.fieldpoc = {
|
||||
description = "Fieldpoc daemon";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "network-online.target" "yate.service" ];
|
||||
requires = [ "network-online.target" "yate.service" "postgresql.service" ];
|
||||
after = [ "network-online.target" "yate.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
|
|
@ -78,6 +78,10 @@ in {
|
|||
if [ ! -f "/var/lib/fieldpoc/extensions.json" ]; then
|
||||
echo '{"extensions": {}}' > /var/lib/fieldpoc/extensions.json
|
||||
fi
|
||||
|
||||
if [ $(${config.services.postgresql.finalPackage}/bin/psql -q -t -A -c "select count(*) from information_schema.tables where table_schema='fieldpoc';") -eq 0 ]; then
|
||||
${pkgs.fieldpoc}/bin/fieldpoc -c /run/fieldpoc/config.json --debug --init
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
@ -94,6 +98,7 @@ in {
|
|||
CREATE ROLE fieldpoc WITH LOGIN PASSWORD 'fieldpoc' CREATEDB;
|
||||
CREATE DATABASE fieldpoc;
|
||||
GRANT ALL PRIVILEGES ON DATABASE fieldpoc TO fieldpoc;
|
||||
GRANT USAGE, CREATE ON SCHEMA public TO fieldpoc;
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue