Include instructions on making sure MySQL/MariaDB starts before WeeWX

Alternative to PR #1030.
This commit is contained in:
Tom Keffer
2025-11-12 13:33:07 -08:00
parent 758690f750
commit 4d470f3405
2 changed files with 19 additions and 0 deletions

View File

@@ -91,3 +91,14 @@ again assuming user `weewx` with password `weewx`. Adjust as necessary.
CREATE USER 'weewx'@'localhost' IDENTIFIED BY 'weewx';
GRANT select, update, create, delete, insert, alter, drop ON weewx.* TO weewx@localhost;
```
### 5. Make sure MySQL/MariaDB starts before WeeWX
You may want to add the following to your `weewx.service` file (generally
located in `/etc/systemd/system/weewx.service`), under the `[Unit]` section:
```ini
After=mariadb.service mysqld.service
Wants=mariadb.service mysqld.service
```
This will ensure that MySQL/MariaDB starts before WeeWX.

View File

@@ -8,6 +8,14 @@ After=time-sync.target
Wants=network-online.target
After=network-online.target
# If you are using MySQL uncomment the following lines:
# After=mysqld.service
# Wants=mysqld.service
# If you are using MariaDB uncomment the following lines:
# After=mariadb.service
# Wants=mariadb.service
[Service]
ExecStart=WEEWX_PYTHON WEEWXD WEEWX_CFGDIR/weewx.conf
StandardOutput=null