mirror of
https://github.com/Djeeberjr/fw-anwesenheit.git
synced 2025-07-04 09:54:17 +00:00
moved systemd services
also added env file for config
This commit is contained in:
parent
6b9ef20187
commit
434353b1e3
@ -22,3 +22,7 @@ Environment variables:
|
|||||||
- `HOTSPOT_SSID`: Set the hotspot ssid. Defaults to "fwa".
|
- `HOTSPOT_SSID`: Set the hotspot ssid. Defaults to "fwa".
|
||||||
- `HOTSPOT_PW`: Set the hotspot password. Default to "a9LG2kUVrsRRVUo1". Recommended to change.
|
- `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
19
service/fwa-fail.service
Normal 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
5
service/fwa.env
Normal 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
|
@ -4,6 +4,7 @@ Requires=local-fs.target
|
|||||||
After=local-fs.target
|
After=local-fs.target
|
||||||
StartLimitIntervalSec=500
|
StartLimitIntervalSec=500
|
||||||
StartLimitBurst=5
|
StartLimitBurst=5
|
||||||
|
OnFailure= fwa-fail.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
@ -13,12 +14,7 @@ RestartSec=5
|
|||||||
User=root
|
User=root
|
||||||
Group=root
|
Group=root
|
||||||
WorkingDirectory=/var/lib/fwa
|
WorkingDirectory=/var/lib/fwa
|
||||||
|
EnvironmentFile=/etc/fwa.env
|
||||||
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"
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
Loading…
x
Reference in New Issue
Block a user