Files
HBlink4/hblink4-dash.service
cortandClaude Opus 5 331fe8814c Add scripts/install_services.sh to install the systemd units
The shipped unit files carry the author's user and paths (User=cort,
/home/cort/hblink4), so copying them verbatim produces two services that
fail to start. The docs said so only in a Customization section below the
copy instructions, and told people to edit the repo copies -- which then
conflict on the next git pull.

The installer prompts for the service user and group (defaulting to the
invoking sudo user and their primary group), substitutes them and the
detected installation path into both units, installs to
/etc/systemd/system/, reloads systemd, and optionally enables and starts
the services. It backs up existing units, refuses unknown users/groups,
checks the venv exists, warns when the service user cannot write the
installation directory, and verifies the substitution landed before
leaving anything in place. DESTDIR previews the output without touching
the live system.

The manual instructions now say to copy first and edit the installed
copy, and note that daemon-reload is required after any unit change. Both
unit files carry a header saying the same.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 21:08:47 -05:00

31 lines
900 B
Desktop File

# NOTE: this file ships with the author's user and install paths. Change User=,
# Group=, WorkingDirectory= and ExecStart= below to match your system.
# Edit the installed copy in /etc/systemd/system/, not this one, and run
# "sudo systemctl daemon-reload" after any change. See SYSTEMD.md.
[Unit]
Description=HBlink4 Dashboard
After=network.target hblink4.service
Wants=hblink4.service
[Service]
Type=simple
User=cort
Group=cort
WorkingDirectory=/home/cort/hblink4
ExecStart=/home/cort/hblink4/venv/bin/python /home/cort/hblink4/dashboard/server.py
Restart=always
RestartSec=10
# Security hardening
# NOTE: do not add PrivateTmp=true here. See the note in hblink4.service --
# a private /tmp breaks the 'unix' event transport between the two services.
NoNewPrivileges=true
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=hblink4-dash
[Install]
WantedBy=multi-user.target