Skip to content

Commit

Permalink
Merge pull request #2823 from opensourcerouting/snap-staticd
Browse files Browse the repository at this point in the history
Updates to snap package to support staticd
  • Loading branch information
donaldsharp authored Aug 14, 2018
2 parents 067d502 + 138aa67 commit 4354a80
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ EXTRA_DIST = frr-sphinx.mk \
user/vnc.rst \
user/vtysh.rst \
user/zebra.rst \
user/flowspec.rst \
mpls/ChangeLog.opaque.txt \
mpls/ospfd.conf \
mpls/cli_summary.txt \
Expand Down
Empty file.
1 change: 1 addition & 0 deletions snapcraft/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

20 changes: 20 additions & 0 deletions snapcraft/scripts/staticd-service
Original file line number Diff line number Diff line change
@@ -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

9 changes: 9 additions & 0 deletions snapcraft/snapcraft.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion vtysh/vtysh_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ int main(int argc, char **argv, char **env)
break;
case OPTION_CONFDIR:
ditch_suid = 1; /* option disables SUID */
strlcpy(sysconfdir, optarg, sizeof(sysconfdir));
snprintf(sysconfdir, sizeof(sysconfdir), "%s/", optarg);
break;
case 'N':
if (strchr(optarg, '/') || strchr(optarg, '.')) {
Expand Down

0 comments on commit 4354a80

Please sign in to comment.