Recommend systemd user lingering

This commit is contained in:
Federico Jaramillo Martinez
2026-05-09 20:20:44 +02:00
parent c13c7072e3
commit fc24e06324
2 changed files with 51 additions and 1 deletions
+19
View File
@@ -92,9 +92,15 @@ Recommended install uses npm plus systemd user services:
```bash
npm install -g @jmfederico/pi-web
# Recommended on servers: keep user services running after logout/reboot.
sudo loginctl enable-linger "$USER"
pi-web install
```
`loginctl enable-linger` is optional for local desktop use, but recommended on servers. It lets the user systemd manager start at boot and continue running after you log out, so Pi Web remains available without an active SSH/login session.
This writes and starts:
- `~/.config/systemd/user/pi-web-sessiond.service`
@@ -102,6 +108,12 @@ This writes and starts:
The generated services run through `bash -lc` so they see a shell environment similar to running `pi` from your terminal.
To check whether lingering is enabled:
```bash
loginctl show-user "$USER" -p Linger
```
Open <http://127.0.0.1:8504>.
Useful commands:
@@ -236,6 +248,13 @@ Restart=no
WantedBy=default.target
```
On servers, enable persistent user services so the user systemd manager starts at boot and remains running after logout:
```bash
sudo loginctl enable-linger "$USER"
loginctl show-user "$USER" -p Linger
```
After creating or changing units:
```bash