summaryrefslogtreecommitdiffstats
path: root/pkgsrc
diff options
context:
space:
mode:
authorgdt <gdt>2004-08-27 17:57:35 +0200
committergdt <gdt>2004-08-27 17:57:35 +0200
commit69f1fc22f70b4baed62582cbaaefaf374665791c (patch)
tree27c18783fb335758e2008533ec8980316ef57862 /pkgsrc
parentBrown paperbag, please. Don't segfault if VTYSH_PAGER isn't defined. (diff)
downloadfrr-69f1fc22f70b4baed62582cbaaefaf374665791c.tar.xz
frr-69f1fc22f70b4baed62582cbaaefaf374665791c.zip
Add start/stop scripts for the rc.d framework used by
pkgsrc (NetBSD and others). Contributed by Miles Nordin.
Diffstat (limited to 'pkgsrc')
-rw-r--r--pkgsrc/Makefile.am1
-rw-r--r--pkgsrc/README.txt7
-rw-r--r--pkgsrc/bgpd.sh44
-rw-r--r--pkgsrc/ospf6d.sh44
-rw-r--r--pkgsrc/ospfd.sh44
-rw-r--r--pkgsrc/ripd.sh44
-rw-r--r--pkgsrc/ripngd.sh44
-rw-r--r--pkgsrc/zebra.sh55
8 files changed, 283 insertions, 0 deletions
diff --git a/pkgsrc/Makefile.am b/pkgsrc/Makefile.am
new file mode 100644
index 000000000..4db92ab41
--- /dev/null
+++ b/pkgsrc/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = bgpd.sh ospf6d.sh ospfd.sh ripd.sh ripngd.sh zebra.sh
diff --git a/pkgsrc/README.txt b/pkgsrc/README.txt
new file mode 100644
index 000000000..13ec449a1
--- /dev/null
+++ b/pkgsrc/README.txt
@@ -0,0 +1,7 @@
+$Id: README.txt,v 1.1 2004/08/27 15:57:35 gdt Exp $
+
+This directory contains files for use with the pkgsrc framework
+(http://www.pkgsrc.org) used with NetBSD and other operating systems.
+Eventually it will be hooked into automake such that they can be
+installed in /usr/pkg/etc/rc.d (via configure option, probably).
+
diff --git a/pkgsrc/bgpd.sh b/pkgsrc/bgpd.sh
new file mode 100644
index 000000000..b150e9f0c
--- /dev/null
+++ b/pkgsrc/bgpd.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# bgpd is part of the quagga routing beast
+#
+# PROVIDE: bgpd
+# REQUIRE: zebra
+##
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+export PATH
+
+if [ -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="bgpd"
+rcvar=$name
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+command="@PREFIX@/sbin/${name}"
+command_args="-d"
+
+start_precmd="zebra_precmd"
+socket_dir=/var/run/zebra
+pidfile="${socket_dir}/${name}.pid"
+
+zebra_precmd()
+{
+ rc_flags="$(
+ set -- $rc_flags
+ while [ $# -ne 0 ]; do
+ if [ X"$1" = X-P -o X"$1" = X-A ]; then
+ break
+ fi
+ shift
+ done
+ if [ $# -eq 0 ]; then
+ echo "-P 0"
+ fi
+ ) $rc_flags"
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/pkgsrc/ospf6d.sh b/pkgsrc/ospf6d.sh
new file mode 100644
index 000000000..b00882331
--- /dev/null
+++ b/pkgsrc/ospf6d.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# ospf6d is part of the quagga routing beast
+#
+# PROVIDE: ospf6d
+# REQUIRE: zebra
+##
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+export PATH
+
+if [ -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="ospf6d"
+rcvar=$name
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+command="@PREFIX@/sbin/${name}"
+command_args="-d"
+
+start_precmd="zebra_precmd"
+socket_dir=/var/run/zebra
+pidfile="${socket_dir}/${name}.pid"
+
+zebra_precmd()
+{
+ rc_flags="$(
+ set -- $rc_flags
+ while [ $# -ne 0 ]; do
+ if [ X"$1" = X-P -o X"$1" = X-A ]; then
+ break
+ fi
+ shift
+ done
+ if [ $# -eq 0 ]; then
+ echo "-P 0"
+ fi
+ ) $rc_flags"
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/pkgsrc/ospfd.sh b/pkgsrc/ospfd.sh
new file mode 100644
index 000000000..c8522119e
--- /dev/null
+++ b/pkgsrc/ospfd.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# ospfd is part of the quagga routing beast
+#
+# PROVIDE: ospfd
+# REQUIRE: zebra
+##
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+export PATH
+
+if [ -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="ospfd"
+rcvar=$name
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+command="@PREFIX@/sbin/${name}"
+command_args="-d"
+
+start_precmd="zebra_precmd"
+socket_dir=/var/run/zebra
+pidfile="${socket_dir}/${name}.pid"
+
+zebra_precmd()
+{
+ rc_flags="$(
+ set -- $rc_flags
+ while [ $# -ne 0 ]; do
+ if [ X"$1" = X-P -o X"$1" = X-A ]; then
+ break
+ fi
+ shift
+ done
+ if [ $# -eq 0 ]; then
+ echo "-P 0"
+ fi
+ ) $rc_flags"
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/pkgsrc/ripd.sh b/pkgsrc/ripd.sh
new file mode 100644
index 000000000..6ba86c4b6
--- /dev/null
+++ b/pkgsrc/ripd.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# ripd is part of the quagga routing beast
+#
+# PROVIDE: ripd
+# REQUIRE: zebra
+##
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+export PATH
+
+if [ -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="ripd"
+rcvar=$name
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+command="@PREFIX@/sbin/${name}"
+command_args="-d"
+
+start_precmd="zebra_precmd"
+socket_dir=/var/run/zebra
+pidfile="${socket_dir}/${name}.pid"
+
+zebra_precmd()
+{
+ rc_flags="$(
+ set -- $rc_flags
+ while [ $# -ne 0 ]; do
+ if [ X"$1" = X-P -o X"$1" = X-A ]; then
+ break
+ fi
+ shift
+ done
+ if [ $# -eq 0 ]; then
+ echo "-P 0"
+ fi
+ ) $rc_flags"
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/pkgsrc/ripngd.sh b/pkgsrc/ripngd.sh
new file mode 100644
index 000000000..ff45b4ed5
--- /dev/null
+++ b/pkgsrc/ripngd.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# ripngd is part of the quagga routing beast
+#
+# PROVIDE: ripngd
+# REQUIRE: zebra
+##
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+export PATH
+
+if [ -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="ripngd"
+rcvar=$name
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+command="@PREFIX@/sbin/${name}"
+command_args="-d"
+
+start_precmd="zebra_precmd"
+socket_dir=/var/run/zebra
+pidfile="${socket_dir}/${name}.pid"
+
+zebra_precmd()
+{
+ rc_flags="$(
+ set -- $rc_flags
+ while [ $# -ne 0 ]; do
+ if [ X"$1" = X-P -o X"$1" = X-A ]; then
+ break
+ fi
+ shift
+ done
+ if [ $# -eq 0 ]; then
+ echo "-P 0"
+ fi
+ ) $rc_flags"
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/pkgsrc/zebra.sh b/pkgsrc/zebra.sh
new file mode 100644
index 000000000..e4750f742
--- /dev/null
+++ b/pkgsrc/zebra.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# zebra is the head of the quagga routing beast
+#
+# PROVIDE: zebra
+# REQUIRE: NETWORKING
+##
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+export PATH
+
+if [ -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="zebra"
+rcvar=$name
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+command="@PREFIX@/sbin/${name}"
+command_args="-d"
+
+start_precmd="zebra_precmd"
+stop_postcmd="zebra_postcmd"
+socket_dir=/var/run/zebra
+pidfile="${socket_dir}/${name}.pid"
+
+zebra_precmd()
+{
+ mkdir -p "${socket_dir}"
+ chown quagga.quagga "${socket_dir}"
+ chmod 750 "${socket_dir}"
+ rc_flags="$(
+ set -- $rc_flags
+ while [ $# -ne 0 ]; do
+ if [ X"$1" = X-P -o X"$1" = X-A ]; then
+ break
+ fi
+ shift
+ done
+ if [ $# -eq 0 ]; then
+ echo "-P 0"
+ fi
+ ) $rc_flags"
+}
+
+zebra_postcmd()
+{
+ if [ -d "${socketdir}" ]; then
+ rmdir ${socketdir}
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"