Skip to content

Commit

Permalink
F93: Update install function and add iptables
Browse files Browse the repository at this point in the history
Signed-off-by: Jaime <[email protected]>
  • Loading branch information
jaimecb committed Nov 22, 2024
1 parent a1b7ca5 commit 4aa3eee
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
40 changes: 24 additions & 16 deletions appliances/VRouter/DHCP4v2/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,29 @@ def generate_config(basedir, vars)
def install(initdir: '/etc/init.d')
msg :info, 'DHCP4v2::install'

file "#{initdir}/one-dhcp4v2", <<~SERVICE, mode: 'u=rwx,g=rx,o='
#!/sbin/openrc-run
source /run/one-context/one_env
command="/etc/one-appliance/service.d/VRouter/DHCP4v2/dhcpcore-onelease/dhcpcore-onelease"
#TODO: command_args
output_log="/var/log/one-appliance/one-dhcp4v2.log"
error_log="/var/log/one-appliance/one-dhcp4v2.log"
depend() {
after net firewall keepalived
}
SERVICE
file "#{initdir}/one-dhcp4v2", <<~SERVICE, :mode => 'u=rwx,g=rx,o='
#!/sbin/openrc-run
source /run/one-context/one_env
BASE_DIR="/etc/one-appliance/service.d/VRouter/DHCP4v2/dhcpcore-onelease"
CONFIG_FILE="$BASE_DIR/config.yml"
SERVICE_EXEC="$BASE_DIR/dhcpcore-onelease"
PIDFILE="/run/$RC_SVCNAME.pid"
LOG_DIR="/var/log/one-appliance"
LOG_FILE="$LOG_DIR/$RC_SVCNAME.log"
command="$SERVICE_EXEC"
command_args="-c $CONFIG_FILE"
command_background="yes"
pidfile="$PIDFILE"
output_log="$LOG_FILE"
error_log="$LOG_FILE"
depend() {
after net firewall keepalived
}
SERVICE
toggle [:update]
end

Expand Down Expand Up @@ -160,4 +168,4 @@ def bootstrap
msg :info, 'DHCP4v2::bootstrap'
end
end
end
end
2 changes: 1 addition & 1 deletion packer/service_VRouter/10-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ service haveged stop ||:

apk update

apk add bash curl ethtool gawk grep iproute2 jq ruby sed tcpdump go
apk add bash curl ethtool gawk grep iproute2 jq ruby sed tcpdump go iptables

sync

0 comments on commit 4aa3eee

Please sign in to comment.