f-8: import local info for start/deploy metadata #8
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
2c6c1ff2df
commit
e3583e7021
2 changed files with 27 additions and 0 deletions
10
systemd/metadata_service/metadata@.service
Normal file
10
systemd/metadata_service/metadata@.service
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=metadata in netns %i
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/run-metadata-in-netns.sh %i
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
17
systemd/metadata_start/run-metadata-in-netns.sh
Normal file
17
systemd/metadata_start/run-metadata-in-netns.sh
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Expects one argument: netns_bridge (e.g. vpc-00003_br-00002 or vpc1_br0)
|
||||
arg="$1"
|
||||
NETNS="${arg%%_*}"
|
||||
ip_port="${arg#*_}"
|
||||
IP="${ip_port%%-*}"
|
||||
PORT="${ip_port#*-}"
|
||||
|
||||
echo "start metadata ${NETNS} "
|
||||
|
||||
exec ip netns exec "${NETNS}" \
|
||||
/usr/bin/metadata \
|
||||
-file "/opt/metadata/${arg}.conf" \
|
||||
-interface "${IP}" \
|
||||
-port "${PORT}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue