From 356ec0364ffadb554b04d016aa6386334a9a3eef Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 19 Feb 2024 10:59:14 -0700 Subject: [PATCH] Adding help for wrolpi logs. --- docs/index.md | 1 + docs/system/index.md | 3 +- docs/system/logs.md | 45 +++++++++++++++++++++++ docs/system/primary-secondary-tertiary.md | 2 +- docs/system/systemd.md | 10 +++++ 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 docs/system/logs.md create mode 100644 docs/system/systemd.md diff --git a/docs/index.md b/docs/index.md index 4b9e835..f230ca2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,6 +18,7 @@ Information about a WROLPi system. * [Getting Started](system/getting-started.md) * [Getting Help](system/getting-help.md) +* [Logs](system/logs.md) * [Systems](system/index.md) * [Recommended Hardware](system/recommended-hardware.md) diff --git a/docs/system/index.md b/docs/system/index.md index 2f63f14..be0c57d 100644 --- a/docs/system/index.md +++ b/docs/system/index.md @@ -8,6 +8,7 @@ * [Map](#map) (`:8084`) * [Zim](#zim) (`:8085`) * [Help](#help) (`:8086`) +* WROLPi services are started and maintained by `systemd`. [Logs](logs.md) are gathered by `systemd`. ## Services @@ -36,7 +37,7 @@ the development environment.) |-------------------------------------------|----------------------------------------------------------------------| | [Postgresql](https://www.postgresql.org/) | Facilitates searching of files, scheduling downloads, and much more. | -### App +### React App | Software Project | Purpose | |----------------------------------------------|--------------------------------------------------------------------| diff --git a/docs/system/logs.md b/docs/system/logs.md new file mode 100644 index 0000000..aff1a51 --- /dev/null +++ b/docs/system/logs.md @@ -0,0 +1,45 @@ +# Logs + +The following is a simple overview to view the logs of the [WROLPi Services](index.md#services). WROLPi logs are +gathered by `systemd`. Logs are viewed using `journalctl`. + +You can watch all the logs on your WROLPi: + +`journalctl -f` + +More detailed logs can be viewed: + +`journalctl -f -p debug` + +To view logs only from the most recent boot: + +`journalctl -f -b` + +The above commands use `-f` (follow) which will display logs as soon as they are created. You can view older logs by +removing `-f` from the command, but you will need to use your keyboard to navigate the logs. Use `up`, `down`, +`page-up` and `page-down` keys. You can also use `g` to navigate to the top of the log, and `shift-g` to navigate to +the bottom of the logs. + +## API + +To watch the API logs: + +`journalctl -f -u wrolpi-api` + +## React App + +To watch the React App logs: + +`journalctl -f -u wrolpi-app` + +## Map + +To watch the Map logs: + +`journalctl -f -u renderd` + +## Zim + +To watch the React App logs: + +`journalctl -f -u wrolpi-kiwix` diff --git a/docs/system/primary-secondary-tertiary.md b/docs/system/primary-secondary-tertiary.md index 633c945..b31726c 100644 --- a/docs/system/primary-secondary-tertiary.md +++ b/docs/system/primary-secondary-tertiary.md @@ -1,6 +1,6 @@ # Primary, Secondary, Tertiary. -WROLPI attempts to integrate all services in an easy to learn interface. But, if the React app is unavailable, secondary +WROLPi attempts to integrate all services in an easy to learn interface. But, if the React app is unavailable, secondary and tertiary options to use your WROLPi may be available. | Module | Primary | Secondary | Tertiary | diff --git a/docs/system/systemd.md b/docs/system/systemd.md new file mode 100644 index 0000000..5a87544 --- /dev/null +++ b/docs/system/systemd.md @@ -0,0 +1,10 @@ +# Service Control + +You can view and control the WROLPi services using these commands: + +| Service | Status | Logs | Restart | Stop | Start | +|-----------|---------------------------------|---------------------------|----------------------------------|-------------------------------|--------------------------------| +| API | `systemctl status wrolpi-api` | `journalctl wrolpi-api` | `systemctl restart wrolpi-api` | `systemctl stop wrolpi-api` | `systemctl start wrolpi-api` | +| React App | `systemctl status wrolpi-app` | `journalctl wrolpi-app` | `systemctl restart wrolpi-app` | `systemctl stop wrolpi-app` | `systemctl start wrolpi-app` | +| Map | `systemctl status renderd` | `journalctl renderd` | `systemctl restart renderd` | `systemctl stop renderd` | `systemctl start renderd` | +| Zim | `systemctl status wrolpi-kiwix` | `journalctl wrolpi-kiwix` | `systemctl restart wrolpi-kiwix` | `systemctl stop wrolpi-kiwix` | `systemctl start wrolpi-kiwix` |