Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Run PaperPi as a systemd service on a Raspberry Pi (M6)

Đã đóng
#295 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Một pull request liên quan đã được merge.

  • #297 của @txoof-bot — đã merge

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
linux, python
Lĩnh vực
devops, infrastructure

Hướng nghiên cứu

Start with the existing service notification behavior referenced in M4 #220 and process shutdown behavior in #209, then inspect the install/ area and the planned install/paperpi.service and install/install.sh entry points. Check the service settings with systemd-analyze verify and the CI checks described in the issue. Done means boot starts PaperPi, a killed main process is restarted without leaving an old process, and systemctl stop clears the screen within 45 seconds.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

in-progress

What

Run PaperPi v2 as a systemd service on a Raspberry Pi: it starts at boot, is restarted after a crash or a stuck loop, and stops cleanly. This comes before the Docker install of M6, so this Pi (9.7" IT8951) can show PaperPi all the time. Includes #209.

Plan

  • install/paperpi.service, the service file:
    • Type=notify and WatchdogSec=120: systemd counts PaperPi as started after READY=1 and restarts it when no "still running" message comes for 2 minutes (PaperPi already sends these, M4 #220).
    • NotifyAccess=main (the default): only the main process counts, not plugin processes.
    • RuntimeDirectory=paperpi (makes /run/paperpi for the health file), StateDirectory=paperpi (/var/lib/paperpi).
    • TimeoutStopSec=45: longer than the exit clear of the screen (30 s) plus the check (2 s).
    • ExecReload sends SIGHUP, so systemctl reload paperpi applies config changes.
    • Restart=on-failure, with a limit on restarts in a row so a broken setup can't loop forever.
    • Keep the default KillMode=control-group: stopping the service ends every PaperPi process (#209).
    • Runs as its own user with access to SPI and GPIO only; extra protection settings where they don't block the screen or the web interface.
  • install/install.sh (run with sudo): makes the user, installs PaperPi into its own folder with uv, writes a starting config to /etc/paperpi/paperpi.toml if there is none, installs and starts the service. Also an update command and an uninstall command.
  • Tests:
    • CI: check the service file has the settings above (and no KillMode=process/none), and systemd-analyze verify passes.
    • On this Pi: a check script that starts the service, kills the main process with kill -9, and confirms no PaperPi process is left (#209); and that systemctl stop clears the screen within the time limit.
  • docs/install-systemd.md: install, update, uninstall, logs (journalctl -u paperpi), reload, where the files are.

PR split

One PR, about 400–550 changed lines: service file, install/update/uninstall script, tests, docs. If it grows past ~800 lines, the update and uninstall commands move to a second PR.

Done when

  • After a reboot of this Pi, the 9.7" screen shows PaperPi without anyone starting it.
  • kill -9 of the main process: systemd starts PaperPi again, and no old process is left.
  • systemctl stop paperpi stops within 45 s and clears the screen.

Area

install (install/).

Ngôn ngữ chính
Python
Star
205
Fork
17
Merge trung bình
5 giờ 9 phút
Pull request đã merge (30 ngày)
56

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của txoof/PaperPi

Tất cả issue của txoof/PaperPi

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.