docs: add systemd service section
This commit is contained in:
parent
3397a2ffa1
commit
36fab2bef0
1 changed files with 31 additions and 1 deletions
32
README.md
32
README.md
|
|
@ -1,4 +1,4 @@
|
||||||
# computer
|
# computer-statistics
|
||||||
|
|
||||||
Sends statistics of my computer to my [API](https://github.com/trafficlunar/api) that can be seen on my [website](https://github.com/trafficlunar/website)
|
Sends statistics of my computer to my [API](https://github.com/trafficlunar/api) that can be seen on my [website](https://github.com/trafficlunar/website)
|
||||||
|
|
||||||
|
|
@ -24,3 +24,33 @@ KERNEL=="kbd*", SUBSYSTEM=="input", TAG+="uaccess"
|
||||||
```
|
```
|
||||||
|
|
||||||
Restart your computer.
|
Restart your computer.
|
||||||
|
|
||||||
|
## systemd service
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ sudo nano /etc/systemd/system/computer-statistics.service
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
[Unit]
|
||||||
|
Description=Computer statistics client
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=always
|
||||||
|
User=trafficlunar
|
||||||
|
WorkingDirectory=/home/trafficlunar/Projects/computer-statistics
|
||||||
|
ExecStart=/home/trafficlunar/Projects/computer-statistics/target/release/computer
|
||||||
|
Environment="RUST_LOG=info"
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ sudo systemctl daemon-reload
|
||||||
|
$ cargo build --release
|
||||||
|
$ sudo systemctl enable --now computer-statistics.service
|
||||||
|
$ sudo systemctl status computer-statistics.service
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue