File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh /etc/rc.common
2+
3+ # copy this file to /etc/init.d/cpud
4+ # You need to put a public key in /etc/cpud.pub
5+ # you need to put a cpud in /usr/sbin
6+ # Build the cpud as follows:
7+ # CGO_ENABLED=0 GOARCH=riscv64 GOOS=linux go build .
8+ # OR CGO_ENABLED=0 GOPATH=a/go/path GOOS=linux GOARCH=riscv64 go install github.com/u-root/cpu/cmds/cpud@latest
9+
10+ # Enable at boot: /etc/init.d/cpud enable
11+ # Disable at boot: /etc/init.d/cpud disable
12+ # Start now: /etc/init.d/cpud start
13+ # Stop now: /etc/init.d/cpud stop
14+
15+ START=99 # Start priority (higher numbers start later)
16+ STOP=10 # Stop priority (lower numbers stop earlier)
17+ USE_PROCD=1 # Use procd to manage the service
18+
19+ start_service () {
20+ procd_open_instance
21+ procd_set_param command /usr/sbin/cpud
22+ procd_append_param command -pk /etc/cpud.pub
23+
24+ # Respawn service if it crashes
25+ procd_set_param respawn
26+
27+ # Redirect stdout and stderr to the system log
28+ procd_set_param stdout 1
29+ procd_set_param stderr 1
30+
31+ procd_close_instance
32+ }
You can’t perform that action at this time.
0 commit comments