moved systemd services

also added env file for config
This commit is contained in:
Djeeberjr 2025-06-05 15:06:44 +02:00
parent 6b9ef20187
commit 434353b1e3
4 changed files with 30 additions and 6 deletions

View File

@ -22,3 +22,7 @@ Environment variables:
- `HOTSPOT_SSID`: Set the hotspot ssid. Defaults to "fwa".
- `HOTSPOT_PW`: Set the hotspot password. Default to "a9LG2kUVrsRRVUo1". Recommended to change.
Systemd:
The service is run as a systemd service. There are two service `fwa.service` and `fwa-fail.service`. They read their config
from a env file located at `/etc/fwa.env`. See example [env file](service/fwa.env).

19
service/fwa-fail.service Normal file
View File

@ -0,0 +1,19 @@
[Unit]
Description=Failure state for fwa.service
Requires=local-fs.target
After=local-fs.target
StartLimitIntervalSec=500
StartLimitBurst=5
[Service]
Type=simple
ExecStart=/usr/local/bin/fwa --error
Restart=on-failure
RestartSec=5
User=root
Group=root
WorkingDirectory=/var/lib/fwa
EnvironmentFile=/etc/fwa.env
[Install]
WantedBy=multi-user.target

5
service/fwa.env Normal file
View File

@ -0,0 +1,5 @@
PM3_BIN=/usr/local/bin/pm3/pm3
LOG_LEVEL=warn
HOTSPOT_IDS=578B5DF2;c1532b57
HOTSPOT_SSID=fwa
HOTSPOT_PW=a9LG2kUVrsRRVUo1

View File

@ -4,6 +4,7 @@ Requires=local-fs.target
After=local-fs.target
StartLimitIntervalSec=500
StartLimitBurst=5
OnFailure= fwa-fail.service
[Service]
Type=simple
@ -13,12 +14,7 @@ RestartSec=5
User=root
Group=root
WorkingDirectory=/var/lib/fwa
Environment="PM3_BIN=/usr/local/bin/pm3/pm3"
#Environment="LOG_LEVEL=warn"
#Environment="HOTSPOT_IDS=578B5DF2;c1532b57"
#Environment="HOTSPOT_SSID=fwa"
#Environment="HOTSPOT_PW=a9LG2kUVrsRRVUo1"
EnvironmentFile=/etc/fwa.env
[Install]
WantedBy=multi-user.target