Install under procd, so OpenWrt counts as a host too
The binary was already static and musl-clean; the only thing standing between Ham Lab and an OpenWrt box was that setup.go knew systemd and OpenRC and nothing else, so an install there ended at "nothing starts it at boot." Adds an embedded procd init script, detected on /sbin/procd + /etc/rc.common ahead of the OpenRC branch. Both backends write /etc/init.d/hamlab, so uninstall tells them apart by USE_PROCD=1 rather than by path. Verified on the new router: procd supervises the instance, S95/K10 symlinks land, and the hub drives its Docker and stacks like any other node. The Updates tab needed nothing — apk-tools 3 answers the same query Alpine's does. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
4e3c817b2a
commit
4450f1285d
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Ham Lab web console (written by hamlab install)
|
||||
|
||||
USE_PROCD=1
|
||||
# after network and firewall, before the tail of the boot
|
||||
START=95
|
||||
STOP=10
|
||||
|
||||
start_service() {
|
||||
procd_open_instance hamlab
|
||||
procd_set_param command "@BIN@" serve
|
||||
procd_set_param env HAMLAB_CONFIG="@CONFIG@" HOME="@HOME@" USER="@USER@"
|
||||
procd_set_param user "@USER@"
|
||||
procd_set_param group "@GROUP@"
|
||||
procd_set_param pidfile /var/run/hamlab.pid
|
||||
# respawn: settle 3s, 5 retries inside that window, then give up counting
|
||||
procd_set_param respawn 3600 3 0
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger network
|
||||
}
|
||||
Reference in New Issue
Block a user