]> git.proxmox.com Git - mirror_frr.git/commitdiff
snapcraft: Add new staticd to snap package
authorMartin Winter <mwinter@opensourcerouting.org>
Sat, 11 Aug 2018 23:44:27 +0000 (16:44 -0700)
committerMartin Winter <mwinter@opensourcerouting.org>
Mon, 13 Aug 2018 21:55:59 +0000 (14:55 -0700)
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
snapcraft/defaults/staticd.conf.default [new file with mode: 0644]
snapcraft/scripts/Makefile
snapcraft/scripts/staticd-service [new file with mode: 0644]
snapcraft/snapcraft.yaml.in

diff --git a/snapcraft/defaults/staticd.conf.default b/snapcraft/defaults/staticd.conf.default
new file mode 100644 (file)
index 0000000..e69de29
index 110f4b2878f62958c0e254d9852d99d02730e778..9a476c6e58d6d4bf162fd375654fea4c9e553cdd 100644 (file)
@@ -15,6 +15,7 @@ install:
        install -D -m 0755 babeld-service $(DESTDIR)/bin/
        install -D -m 0755 eigrpd-service $(DESTDIR)/bin/
        install -D -m 0755 pbrd-service $(DESTDIR)/bin/
+       install -D -m 0755 staticd-service $(DESTDIR)/bin/
        install -D -m 0755 set-options $(DESTDIR)/bin/
        install -D -m 0755 show_version $(DESTDIR)/bin/
 
diff --git a/snapcraft/scripts/staticd-service b/snapcraft/scripts/staticd-service
new file mode 100644 (file)
index 0000000..3b22881
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e -x
+
+if ! [ -e $SNAP_DATA/staticd.conf ]; then
+    if [ -e $SNAP_DATA/zebra.conf ]; then
+        # if we have a zebra.conf, but no staticd conf, then we use
+        # this file as the default config for staticd
+        cp $SNAP_DATA/zebra.conf $SNAP_DATA/staticd.conf
+    else
+        # new config, start with template
+        cp $SNAP/etc/frr/staticd.conf $SNAP_DATA/staticd.conf
+    fi
+fi
+exec $SNAP/sbin/staticd \
+    -f $SNAP_DATA/staticd.conf \
+    --pid_file $SNAP_DATA/staticd.pid \
+    --socket $SNAP_DATA/zsock \
+    --vty_socket $SNAP_DATA
+
index b4e1812c86e03f7facdc66291f8b9ac542d73b3d..48dc69278b629333385f58fd9fe3809ffae21024 100644 (file)
@@ -113,6 +113,13 @@ apps:
             - network
             - network-bind
             - network-control
+    staticd:
+        command: bin/staticd-service
+        daemon: simple
+        plugs:
+            - network
+            - network-bind
+            - network-control
     set:
         command: bin/set-options
     zebra-debug:
@@ -193,6 +200,8 @@ apps:
             - network
             - network-bind
             - network-control
+    staticd-debug:
+        command: sbin/staticd -f $SNAP_DATA/staticd.conf --pid_file $SNAP_DATA/staticd.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA
 
 parts:
     frr: