kazeno memo

メモとか

piping-server-rustのOpenRC initスクリプト

AlpineLinuxでpiping-server-rustをビルドして起動時に実行する。

piping-server-rustのビルド

# apk add --update git curgo

# git clone https://github.com/nwtgck/piping-server-rust.git
# cd piping-server-rust/
# cargo check
# cargo build
# cp ./src/target/piping-server /usr/local/bin/

OpenRC init

Supervisorにはstart-stop-daemonではなくsupervise-daemonを使う。

ポートはデフォルトの8080ではなく80で受ける。

/etc/init.d/piping-server

#!/sbin/openrc-run
supervisor="supervise-daemon"

description="piping-server - Infinite streaming any data over HTTP/HTTPS"

command="/usr/local/bin/piping-server"
command_args="--http-port 80"

depend() {
    need net
    after firewall
}

サービスの有効化

# rc-update add piping-server
# rc-service piping-server start