Switch to manual dummynet rc.d implementation.

The existing one does not seem to work.
This commit is contained in:
Tom Alexander 2024-07-13 14:05:14 -04:00
parent 043061fb16
commit 5d1c1e2e19
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
5 changed files with 43 additions and 5 deletions

View File

@ -1,2 +1,2 @@
dnctl pipe 1 config bw 100KByte/s
dnctl pipe 2 config
pipe 1 config bw 100KByte/s
pipe 2 config

View File

@ -1,2 +0,0 @@
dnctl_enable="YES"
dnctl_rules="/etc/dnctl.conf"

View File

@ -0,0 +1,28 @@
#!/bin/sh
#
#
# PROVIDE: dummynet
# BEFORE: pf ipfw
# KEYWORD: nojailvnet
. /etc/rc.subr
name="dummynet"
desc="Dummynet packet queuing and scheduling"
rcvar="${name}_enable"
load_rc_config $name
start_cmd="${name}_start"
required_files="$dummynet_rules"
required_modules="dummynet"
dummynet_start()
{
startmsg -n "Enabling ${name}"
cat "$dnctl_rules" | while read l; do
dnctl $l
done
startmsg '.'
}
run_rc_command $*

View File

@ -0,0 +1,2 @@
dummynet_enable="YES"
dummynet_rules="/etc/dnctl.conf"

View File

@ -9,6 +9,16 @@
- src: "{{ dummynet_config }}"
dest: /etc/dnctl.conf
- name: Install rc script
copy:
src: "files/{{ item.src }}"
dest: "/usr/local/etc/rc.d/{{ item.dest|default(item.src) }}"
owner: root
group: wheel
mode: 0755
loop:
- src: dummynet
- name: Install service configuration
copy:
src: "files/{{ item }}_rc.conf"
@ -17,4 +27,4 @@
owner: root
group: wheel
loop:
- dnctl
- dummynet