From 5de3caf839186c2244e75a553f9584c6ea299fc3 Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 3 Mar 2025 19:28:35 -0700 Subject: [PATCH] Modifying niceness of WROLPi services to facilitate API startup. --- etc/raspberrypios/wrolpi-api.service | 2 ++ etc/raspberrypios/wrolpi-app.service | 2 ++ etc/raspberrypios/wrolpi-help.service | 2 ++ etc/raspberrypios/wrolpi-kiwix.service | 2 ++ 4 files changed, 8 insertions(+) diff --git a/etc/raspberrypios/wrolpi-api.service b/etc/raspberrypios/wrolpi-api.service index fe35fb61..4cae7c2f 100644 --- a/etc/raspberrypios/wrolpi-api.service +++ b/etc/raspberrypios/wrolpi-api.service @@ -11,6 +11,8 @@ Group=wrolpi User=wrolpi WorkingDirectory=/opt/wrolpi/ Restart=on-failure +# Higher than the App so the API can start. +Nice=4 [Install] WantedBy=default.target diff --git a/etc/raspberrypios/wrolpi-app.service b/etc/raspberrypios/wrolpi-app.service index d6306830..1483bb14 100644 --- a/etc/raspberrypios/wrolpi-app.service +++ b/etc/raspberrypios/wrolpi-app.service @@ -9,6 +9,8 @@ ExecStart=/usr/bin/npm run start Group=wrolpi User=wrolpi WorkingDirectory=/opt/wrolpi/app/ +# Below the API so that Sanic worker can start. +Nice=6 [Install] WantedBy=default.target diff --git a/etc/raspberrypios/wrolpi-help.service b/etc/raspberrypios/wrolpi-help.service index 5eed0add..53aae648 100644 --- a/etc/raspberrypios/wrolpi-help.service +++ b/etc/raspberrypios/wrolpi-help.service @@ -8,6 +8,8 @@ ExecStart=/bin/bash -c 'source /opt/wrolpi-help/venv/bin/activate && exec mkdocs Group=wrolpi User=wrolpi WorkingDirectory=/opt/wrolpi-help/ +# Below the App, but below the user. +Nice=1 [Install] WantedBy=default.target diff --git a/etc/raspberrypios/wrolpi-kiwix.service b/etc/raspberrypios/wrolpi-kiwix.service index b79970d2..8c69caaf 100644 --- a/etc/raspberrypios/wrolpi-kiwix.service +++ b/etc/raspberrypios/wrolpi-kiwix.service @@ -7,6 +7,8 @@ ExecStart=/opt/wrolpi/scripts/start_kiwix_serve.sh Group=wrolpi User=wrolpi WorkingDirectory=/opt/wrolpi/ +# Below the API, but above the Map. +Nice=8 [Install] WantedBy=default.target