Subject: [alpine-devel] patch: fixed init script for rp-pppoe

From: Francesco <[email-masked]>
Date: Tue, 4 Jan 2011 09:53:11 +0100

Now, rp-pppoe uses runscript instead of /bin/sh

Plase review and commit.

Thanks!

:: Francesco Colista
:: Email : [email-masked]
:: Jabber: [email-masked]
From b6a60f16782233cf7dba3987466293dc63a5d4de Mon Sep 17 00:00:00 2001
From: Francesco Colista <[email-masked]>
Date: Tue, 4 Jan 2011 08:53:52 +0000
Subject: [PATCH] rp-pppoe init now use runscript

---
 testing/rp-pppoe/APKBUILD       |   38 ++++++++++++++++++++++++++++++++++++++
 testing/rp-pppoe/rp-pppoe.initd |   30 ++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100644 testing/rp-pppoe/APKBUILD
 create mode 100644 testing/rp-pppoe/rp-pppoe.initd

diff --git a/testing/rp-pppoe/APKBUILD b/testing/rp-pppoe/APKBUILD
new file mode 100644
index 0000000..e953f7e
--- /dev/null
+++ b/testing/rp-pppoe/APKBUILD
@@ -0,0 +1,38 @@
+# Contributor: Francesco Colista <[email-masked]>
+# Maintainer: Francesco Colista <[email-masked]>
+pkgname=rp-pppoe
+pkgver=3.10
+pkgrel=1
+pkgdesc="Roaring Penguin\'s Point-to-Point Protocol over Ethernet client"
+url="http://www.roaringpenguin.com/pppoe/"
+arch="x86 x86_64"
+license="LGPL"
+depends=
+makedepends=
+install=
+subpackages=
+source="http://www.roaringpenguin.com/files/download/rp-pppoe-$pkgver.tar.gz
+	rp-pppoe.initd"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+	cd "$_builddir"/src
+	./configure --prefix=/usr \
+		--sysconfdir=/etc \
+		--mandir=/usr/share/man \
+		--infodir=/usr/share/info 
+
+	make all  || return 1
+}
+
+package() {
+	cd "$_builddir"/src
+	
+	make DESTDIR="$pkgdir" install
+
+	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+}
+
+md5sums="d58a13cc4185bca6121a606ff456dec0  rp-pppoe-3.10.tar.gz
+851f3a5a2fab28aa3b8999656b565e1c  rp-pppoe.initd"
diff --git a/testing/rp-pppoe/rp-pppoe.initd b/testing/rp-pppoe/rp-pppoe.initd
new file mode 100644
index 0000000..3e6ce3e
--- /dev/null
+++ b/testing/rp-pppoe/rp-pppoe.initd
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+
+depend() {
+	need net
+}
+
+start() {
+	ebegin "Starting PPPOE Server"
+	test -x /usr/sbin/pppoe-server -a -f /etc/ppp/pppoe-server-options || exit 0
+	start-stop-daemon --start --exec /usr/sbin/pppoe-server -- ${PPPOE_PARAMS}
+	echo 1 > /proc/sys/net/ipv4/ip_forward
+	eend $?
+}
+
+stop () {
+	ebegin "Stopping PPPOE Server"
+	start-stop-daemon --stop --exec /usr/sbin/pppoe-server
+	echo 0 > /proc/sys/net/ipv4/ip_forward
+	eend $?
+}
+
+restart () {
+        ebegin "Restarting PPPOE Server"
+        start-stop-daemon --stop --exec /usr/sbin/pppoe-server
+        sleep 1
+        start-stop-daemon --start --exec /usr/sbin/pppoe-server -- ${PPPOE_PARAMS}
+        echo 1 > /proc/sys/net/ipv4/ip_forward
+        echo "."
+}
+
-- 
1.7.3.2

---

From: Natanael Copa <[email-masked]>
Date: Tue, 4 Jan 2011 13:15:55 +0100

On Tue, 4 Jan 2011 09:53:11 +0100

> Now, rp-pppoe uses runscript instead of /bin/sh

error: testing/rp-pppoe/APKBUILD: already exists in index
error: testing/rp-pppoe/rp-pppoe.initd: already exists in index
Patch failed at 0001 rp-pppoe init now use runscript

Can you please rebase it against current git master and resend it?

Something like:

git checkout master
git pull --rebase
cd testing/rp-pppoe
# edit files
git add .
git commit  # use 'testing/rp-pppoe: use runscript' as first line in
commit message.

Then:
git send-email --to [email-masked] HEAD^

Thanks!
-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Francesco <[email-masked]>
Date: Tue, 4 Jan 2011 14:07:57 +0100

Ok, this should work.

Thanks!

:: Francesco Colista

> git send-email --to [email-masked] HEAD^
From 5bebdf94ba942624768b017866df0f196d455026 Mon Sep 17 00:00:00 2001
From: Francesco Colista <[email-masked]>
Date: Tue, 4 Jan 2011 13:05:47 +0000
Subject: [PATCH] testing/rp-pppoe: use runscript' as first line in

---
 testing/rp-pppoe/APKBUILD       |    2 +-
 testing/rp-pppoe/rp-pppoe.initd |   57 +++++++++++++++-----------------------
 2 files changed, 24 insertions(+), 35 deletions(-)

diff --git a/testing/rp-pppoe/APKBUILD b/testing/rp-pppoe/APKBUILD
index 40893da..403f697 100644
--- a/testing/rp-pppoe/APKBUILD
+++ b/testing/rp-pppoe/APKBUILD
@@ -2,7 +2,7 @@
 # Maintainer: Francesco Colista <[email-masked]>
 pkgname=rp-pppoe
 pkgver=3.10
-pkgrel=1
+pkgrel=2
 pkgdesc="Roaring Penguin\'s Point-to-Point Protocol over Ethernet client"
 url="http://www.roaringpenguin.com/pppoe/"
 arch="x86 x86_64"
diff --git a/testing/rp-pppoe/rp-pppoe.initd b/testing/rp-pppoe/rp-pppoe.initd
index 7c5bdf6..3e6ce3e 100644
--- a/testing/rp-pppoe/rp-pppoe.initd
+++ b/testing/rp-pppoe/rp-pppoe.initd
@@ -1,41 +1,30 @@
-#!/bin/sh
-#
+#!/sbin/runscript
 
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/pppoe-server
-NAME=pppoe-server
+depend() {
+	need net
+}
 
-# Setup server and service names, Server peer IP, start of IP range for clients peers, amount of peers at same time
-PARAMS="-C XGT01 -S PPPoEC -L 172.19.${BRNUM}.2 -R 172.19.${BRNUM}.100 -N 100"
+start() {
+	ebegin "Starting PPPOE Server"
+	test -x /usr/sbin/pppoe-server -a -f /etc/ppp/pppoe-server-options || exit 0
+	start-stop-daemon --start --exec /usr/sbin/pppoe-server -- ${PPPOE_PARAMS}
+	echo 1 > /proc/sys/net/ipv4/ip_forward
+	eend $?
+}
 
-test -x /usr/sbin/pppoe-server -a -f /etc/ppp/pppoe-server-options || exit 0
+stop () {
+	ebegin "Stopping PPPOE Server"
+	start-stop-daemon --stop --exec /usr/sbin/pppoe-server
+	echo 0 > /proc/sys/net/ipv4/ip_forward
+	eend $?
+}
 
-case "$1" in
-    start)
-        echo -n "Starting up $NAME "
-        start-stop-daemon --start --quiet --pidfile /var/run/$NAME/$NAME.pid --exec $DAEMON -- $PARAMS
-        echo 1 > /proc/sys/net/ipv4/ip_forward
-        echo "."
-        ;;
-    stop)
-        echo -n "Shutting down $NAME "
-        start-stop-daemon --stop --quiet --pidfile /var/run/$NAME/$NAME.pid --exec $DAEMON
-        echo 0 > /proc/sys/net/ipv4/ip_forward
-        killall $DAEMON > /dev/null 2>&1
-        echo "."
-        ;;
-    restart|force-reload)
-        echo -n "Restarting $NAME "
-        start-stop-daemon --stop --quiet --pidfile /var/run/$NAME/$NAME.pid --exec $DAEMON
+restart () {
+        ebegin "Restarting PPPOE Server"
+        start-stop-daemon --stop --exec /usr/sbin/pppoe-server
         sleep 1
-        start-stop-daemon --start --quiet --pidfile /var/run/$NAME/$NAME.pid --exec $DAEMON -- $PARAMS
+        start-stop-daemon --start --exec /usr/sbin/pppoe-server -- ${PPPOE_PARAMS}
+        echo 1 > /proc/sys/net/ipv4/ip_forward
         echo "."
-        ;;
-    *)
-        echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}"
-        exit 1
-        ;;
-esac
-
-exit 0
+}
 
-- 
1.7.3.2

---

From: Natanael Copa <[email-masked]>
Date: Tue, 4 Jan 2011 15:48:27 +0100

On Tue, 4 Jan 2011 14:07:57 +0100

> Thanks!

Applied.

The checksum was bad so i updated it. I also created -doc subpackage
while there.

Thanks!

-nc

---