docs: replace systemd service with user service
This commit is contained in:
parent
65f389c81e
commit
7398e80835
1 changed files with 6 additions and 7 deletions
13
README.md
13
README.md
|
|
@ -28,7 +28,7 @@ Restart your computer.
|
||||||
## systemd service
|
## systemd service
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo nano /etc/systemd/system/computer-statistics.service
|
$ nano /etc/systemd/system/computer-statistics.service
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
@ -39,9 +39,8 @@ After=network.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
Restart=always
|
Restart=always
|
||||||
User=trafficlunar
|
WorkingDirectory=%h/Projects/computer-statistics
|
||||||
WorkingDirectory=/home/trafficlunar/Projects/computer-statistics
|
ExecStart=%h/Projects/computer-statistics/target/release/computer
|
||||||
ExecStart=/home/trafficlunar/Projects/computer-statistics/target/release/computer
|
|
||||||
Environment="RUST_LOG=info"
|
Environment="RUST_LOG=info"
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
@ -49,8 +48,8 @@ WantedBy=multi-user.target
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo systemctl daemon-reload
|
|
||||||
$ cargo build --release
|
$ cargo build --release
|
||||||
$ sudo systemctl enable --now computer-statistics.service
|
$ systemctl --user daemon-reload
|
||||||
$ sudo systemctl status computer-statistics.service
|
$ systemctl --user enable --now computer-statistics.service
|
||||||
|
$ systemctl --user status computer-statistics.service
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue