Files
btest-rs/deploy/alpine/btest.initd
Siavash Sameni 8c853c3605
All checks were successful
CI / test (push) Successful in 2m8s
Parallel agent work: bandwidth fix, CPU platforms, packaging
5 agents ran in parallel:

1. Fix bandwidth limit (-b): new advance_next_send() prevents drift
   bursts by resetting when >2x interval behind (bandwidth.rs, client.rs, server.rs)

2. Windows + FreeBSD CPU support (cpu.rs):
   - Windows: GetSystemTimes via raw FFI
   - FreeBSD: sysctl kern.cp_time parsing

3. Ubuntu .deb packaging (deploy/deb/):
   - build-deb.sh: creates .deb from pre-built binary
   - test-deb.sh: tests in Ubuntu Docker container

4. Fedora/RHEL RPM packaging (deploy/rpm/):
   - btest-rs.spec: full RPM spec with systemd unit
   - build-rpm.sh + test-rpm.sh

5. Alpine Linux apk packaging (deploy/alpine/):
   - APKBUILD with OpenRC init script
   - test-alpine.sh

58 tests pass, zero warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 14:04:00 +04:00

38 lines
758 B
Plaintext
Executable File

#!/sbin/openrc-run
# OpenRC init script for btest-rs
# MikroTik Bandwidth Test server
name="btest"
description="MikroTik Bandwidth Test Server (btest-rs)"
command="/usr/bin/btest"
command_args="-s"
command_background=true
pidfile="/run/$name.pid"
# Run as dedicated user if it exists, otherwise root
command_user="btest:btest"
# Logging
output_log="/var/log/$name/$name.log"
error_log="/var/log/$name/$name.err"
depend() {
need net
after firewall
use dns logger
}
start_pre() {
# Create log directory
checkpath -d -m 0755 -o "$command_user" /var/log/$name
# Create runtime directory
checkpath -d -m 0755 -o "$command_user" /run
}
stop() {
ebegin "Stopping $name"
start-stop-daemon --stop --pidfile "$pidfile" --retry TERM/5/KILL/3
eend $?
}