Compare commits
3 commits
83b1fa6786
...
3288a2a413
| Author | SHA1 | Date | |
|---|---|---|---|
|
3288a2a413 |
|||
|
deac1afe9f |
|||
|
02e558e0e2 |
3 changed files with 50 additions and 0 deletions
|
|
@ -46,6 +46,24 @@ jobs:
|
||||||
goarch: ${{ matrix.goarch }}
|
goarch: ${{ matrix.goarch }}
|
||||||
binari: ${{ matrix.binaries }}
|
binari: ${{ matrix.binaries }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
upload-scripts:
|
||||||
|
runs-on: docker
|
||||||
|
needs: [set-release-target]
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
script:
|
||||||
|
- run-dnsmasq-in-netns.sh
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Move asset
|
||||||
|
run: |
|
||||||
|
mkdir -p "dist"
|
||||||
|
cp scripts/${{ matrix.script }} dist/
|
||||||
|
- name: Upload script
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.script }}-${{ needs.set-release-target.outputs.release_cible }}
|
||||||
|
path: dist/${{ matrix.script }}
|
||||||
prerelease:
|
prerelease:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [set-release-target, build]
|
needs: [set-release-target, build]
|
||||||
|
|
|
||||||
21
scripts/run-dnsmasq-in-netns.sh
Normal file
21
scripts/run-dnsmasq-in-netns.sh
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Expects one argument: netns_bridge (e.g. vpc-00003_br-00002 or vpc1_br0)
|
||||||
|
arg="$1"
|
||||||
|
NETNS="${arg%%_*}"
|
||||||
|
BRIDGE="${arg#*_}"
|
||||||
|
|
||||||
|
echo "start dnsmasq ${NETNS} ${BRIDGE}"
|
||||||
|
|
||||||
|
exec ip netns exec "${NETNS}" \
|
||||||
|
dnsmasq \
|
||||||
|
--no-daemon \
|
||||||
|
--interface="${BRIDGE}" \
|
||||||
|
--bind-interfaces \
|
||||||
|
--pid-file="/run/dnsmasq-$arg.pid" \
|
||||||
|
--conf-file="/etc/dnsmasq.d/$arg.conf" \
|
||||||
|
--no-hosts \
|
||||||
|
--no-resolv \
|
||||||
|
--log-facility="/var/log/dnsmasq-$arg.log" \
|
||||||
|
--no-daemon -p0
|
||||||
11
systemd/dnsmasq@.service
Normal file
11
systemd/dnsmasq@.service
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
[Unit]
|
||||||
|
Description=dnsmasq in netns %i
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/opt/two/bin/run-dnsmasq-in-netns.sh %i
|
||||||
|
ExecStopPost=/bin/rm -f /run/dnsmasq-%i.pid
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Loading…
Add table
Add a link
Reference in a new issue