ci/woodpecker/push/main-amd64-build Pipeline was successful
Namespaces, assemblies, solution, binaries, images, systemd units, config paths, environment variables, protocol methods and the Linux user are all renamed. Breaking: existing databases, node identities and installed units must be recreated.
27 lines
792 B
Bash
27 lines
792 B
Bash
#!/bin/sh /etc/rc.common
|
|
# procd service for moshiro-probe (OpenWrt). Installed as /etc/init.d/moshiro-probe.
|
|
|
|
START=95
|
|
STOP=10
|
|
USE_PROCD=1
|
|
|
|
PROG=/usr/lib/moshiro/moshiro-probe
|
|
CONF=/etc/moshiro/probe.json
|
|
|
|
start_service() {
|
|
[ -f "$CONF" ] || {
|
|
logger -t moshiro-probe "$CONF not found: download it from the panel (POST /api/admin/probe/identity)"
|
|
return 1
|
|
}
|
|
procd_open_instance
|
|
procd_set_param command "$PROG" --config "$CONF"
|
|
# respawn: threshold(s) timeout(s) retry (0 = forever)
|
|
procd_set_param respawn 3600 5 0
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_set_param limits nofile=4096
|
|
# Run unprivileged when the installer could create the user (busybox adduser may be missing)
|
|
id moshiro >/dev/null 2>&1 && procd_set_param user moshiro
|
|
procd_close_instance
|
|
}
|