init script cleanup, use /etc/rc.d/ for enabled scripts, /etc/init.d/<pkgname> (enabl...
authorFelix Fietkau <nbd@openwrt.org>
Sun, 15 Oct 2006 21:03:30 +0000 (21:03 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 15 Oct 2006 21:03:30 +0000 (21:03 +0000)
SVN-Revision: 5128

92 files changed:
admin/monit/files/monit.init
admin/osiris/files/osirisd.init
admin/syslog-ng/Makefile
ipv6/mrd6/Makefile
lang/php4/files/php.init
libs/avahi/files/avahi-daemon.init
libs/howl/files/autoipd.init
libs/howl/files/mDNSResponder.init
libs/howl/files/nifd.init
libs/net-snmp/files/snmpd.init
multimedia/peercast/Makefile
net/aiccu/Makefile
net/asterisk/Makefile
net/asterisk/files/asterisk.init
net/bind/Makefile
net/bitchx/Makefile
net/bitchx/files/S98bitchxrc [deleted file]
net/bitchx/files/bitchxrc.init [new file with mode: 0755]
net/bitlbee/Makefile
net/bitlbee/files/S55bitlbee [deleted file]
net/bitlbee/files/bitlbee.init [new file with mode: 0755]
net/click/Makefile
net/click/files/S50roofnet [deleted file]
net/click/files/roofnet.init [new file with mode: 0755]
net/cups/Makefile
net/freeradius/files/radiusd.init
net/gmediaserver/files/gmediaserver.init
net/htpdate/Makefile
net/htpdate/files/htpdate.init
net/l2tpd/files/l2tpd.init
net/lighttpd/files/lighttpd.init
net/maradns/Makefile
net/miau/Makefile
net/miau/files/S50miau [deleted file]
net/miau/files/miau.init [new file with mode: 0755]
net/miredo/files/miredo-server.init
net/miredo/files/miredo.init
net/netperf/Makefile
net/nfs-kernel-server/Makefile
net/nfs-kernel-server/files/nfsd.init
net/nfs-server/Makefile
net/oidentd/Makefile
net/oidentd/files/S85oidentd [deleted file]
net/oidentd/files/oidentd.init [new file with mode: 0755]
net/olsrd/Makefile
net/olsrd/files/olsrd.init
net/openntpd/Makefile
net/openntpd/files/ntpd.init
net/openssh/Makefile
net/openssh/files/S50sshd [deleted file]
net/openssh/files/sshd.init [new file with mode: 0755]
net/p910nd/Makefile
net/parprouted/Makefile
net/parprouted/files/parprouted.init
net/peerguardian/files/peerguardian.init
net/portmap/Makefile
net/portmap/files/portmap.init
net/pptpd/Makefile
net/pptpd/files/pptpd.init
net/quagga/Makefile
net/quagga/files/quagga [new file with mode: 0644]
net/quagga/files/quagga.init
net/radvd/Makefile
net/rarpd/Makefile
net/rarpd/files/rarpd.init
net/reaim/Makefile
net/reaim/files/reaim.init
net/rp-l2tp/files/rp-l2tpd.init
net/rp-pppoe/files/pppoe-relay.init
net/rp-pppoe/files/pppoe-server.init
net/samba/files/samba.init
net/scanlogd/Makefile
net/siproxd/files/siproxd.init
net/srelay/Makefile
net/tinyproxy/files/tinyproxy.init
net/tor/files/tor.init
net/ulogd/Makefile
net/ulogd/files/ulogd.init
net/updatedd/Makefile
net/updatedd/files/S55ddns [deleted file]
net/updatedd/files/ddns.init [new file with mode: 0644]
net/vrrpd/files/vrrpd.init
net/wifidog/Makefile
net/xinetd/files/xinetd.init
sound/mt-daapd/files/mt-daapd.init
utils/collectd/Makefile
utils/collectd/files/S80collectd [deleted file]
utils/collectd/files/collectd.init [new file with mode: 0755]
utils/rrdcollect/Makefile
utils/rrdcollect/files/rrdcollect.init
utils/setserial/Makefile
utils/setserial/files/serial.init

index 11eb303129ff810018b23dac6bf1e73a87a3c722..c47f4da351830dd92d297ef917fed31de397708c 100644 (file)
@@ -5,9 +5,9 @@ BIN=monit
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $RUN_D
        $BIN $OPTIONS
 }
index 0fc6e76c18fe61329bf4dbd4af7d7e856711a8df..9854f3431b02d64f62df39d441f0ad4c97a1c8ea 100644 (file)
@@ -6,9 +6,9 @@ DEFAULT=/etc/default/$BIN
 LIB_D=/var/lib/osiris
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $LIB_D
        mkdir -p $RUN_D
        $BIN $OPTIONS
index 1ef4e72f4948e611308509c3d08d04632735cf1f..723c3de5878f39cd2a784d5f827d754f5da864f1 100644 (file)
@@ -20,7 +20,6 @@ PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
-PKG_INIT_LEVEL:=60
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -56,7 +55,7 @@ define Package/syslog-ng/install
        install -d -m0755 $(1)/usr/sbin
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/syslog-ng $(1)/usr/sbin/
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/syslog-ng.init $(1)/etc/init.d/S$(PKG_INIT_LEVEL)syslog-ng
+       install -m0755 ./files/syslog-ng.init $(1)/etc/init.d/syslog-ng
        install -d -m0755 $(1)/etc/syslog-ng
        install -m0644 ./files/syslog-ng.conf $(1)/etc/syslog-ng/
 endef
index aab01e41e71165e8bd24ab2879dc9e9635f0f0e5..3d8435e2e3d2e1be35c628b2c49825515fe3bbbf 100644 (file)
@@ -58,7 +58,7 @@ endef
 define Package/mrd6/install
        install -d -m0755 $(1)/etc/init.d
        install -m0644 files/mrd6.conf $(1)/etc
-       install -m0755 files/mrd6.init $(1)/etc/init.d/S60mrd6
+       install -m0755 files/mrd6.init $(1)/etc/init.d/mrd6
 endef
 
 $(eval $(call BuildPackage,mrd6))
index b29387bd745f4465d4bf2fe86c0a91e9e28a8b54..9cf369169a88bf9426f7817855cb8dc4383eb824 100644 (file)
@@ -1,19 +1,11 @@
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
 
-export PHP_FCGI_CHILDREN=''
-PORT=1026
-BIN=/usr/sbin/php
+start() {
+       $BIN -b $PORT &
+}
 
-case $1 in
- start)
-  $BIN -b $PORT &
-  ;;
- stop)
-  kill `pidof php`
-  ;;
- *)
-  echo "usage: $0 (start|stop)"
-  exit 1
-esac
+stop() {
+       killall php
+}
 
-exit $?
index 81ceb9b9391676d249cbfeda04dfde3678473d89..f8bee67090b5da7bd71f56413fb52225a9b46b8e 100644 (file)
@@ -5,9 +5,9 @@ BIN=avahi-daemon
 DEFAULT=/etc/default/$BIN
 OPTIONS="-D"
 RUN_D=/var/run/$BIN
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $RUN_D
        $BIN $OPTIONS
 }
index 3de6e6e23ac04164610fde2844b7db41d41fdd5e..79671534841990907a9e5a16a7b93bcbfbbb40b3 100644 (file)
@@ -4,9 +4,9 @@
 DEFAULT=/etc/default/autopid
 RUN_D=/var/run
 PID_F=$RUN_D/autoipd.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        [ -d $RUN_D ] || mkdir -p $RUN_D
        autoipd $OPTIONS
 }
index aae87c32de38dfbcc1c491e877b9d38a5f5a360f..415caae7df06be32cbfe53fa27cdede1b646a095 100644 (file)
@@ -4,9 +4,9 @@
 DEFAULT=/etc/default/mDNSResponder
 RUN_D=/var/run
 PID_F=$RUN_D/mDNSResponder.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        [ -d $RUN_D ] || mkdir -p $RUN_D
        mDNSResponder $OPTIONS
 }
index 0569e68a2242acde01d6fd064e3348533f51251f..59a3f3bc3c426af09639d94a02421a1c3ceb0b08 100644 (file)
@@ -4,9 +4,9 @@
 DEFAULT=/etc/default/nifd
 RUN_D=/var/run
 PID_F=$RUN_D/nifd.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        [ -d $RUN_D ] || mkdir -p $RUN_D
        nifd $OPTIONS
 }
index 42af3f7aa3b4fe3f6a44371402bc26608ada27ab..d3206e722d274d1da7e7f25d2ee68e7677cdac7e 100644 (file)
@@ -7,9 +7,9 @@ LOG_D=/var/log
 RUN_D=/var/run
 PID_F=$RUN_D/snmpd.pid
 
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        [ -d $LIB_D ] || mkdir -p $LIB_D
        [ -d $LOG_D ] || mkdir -p $LOG_D
        [ -d $RUN_D ] || mkdir -p $RUN_D
index aec2c0944feee3841b70864a6a829b71d44a664a..676fd86645e98b63bf466f9c4df06278cad5b6e0 100644 (file)
@@ -65,7 +65,6 @@ define Package/peercast/install
        install -m0644 ./files/peercast.ini $(1)/etc/
        install -m0755 -d $(1)/etc/init.d
        install -m0755 ./files/peercast.init $(1)/etc/init.d/peercast
-       ln -sf peercast $(1)/etc/init.d/S60peercast
 endef
 
 $(eval $(call BuildPackage,peercast))
index 9d2242e47ec0b8d62cf3c849589acad82eab2b5a..c0b4b3a649f0857af4bf1f3244fcf3502c0395f5 100644 (file)
@@ -43,7 +43,7 @@ endef
 define Package/aiccu/install
        mkdir -p $(1)/usr/sbin $(1)/etc/init.d
        install -m 755 $(PKG_BUILD_DIR)/unix-console/$(PKG_NAME) $(1)/usr/sbin/
-       install -m 755 ./files/aiccu.init $(1)/etc/init.d/S51aiccu
+       install -m 755 ./files/aiccu.init $(1)/etc/init.d/aiccu
        install -m 644 $(PKG_BUILD_DIR)/doc/aiccu.conf $(1)/etc/aiccu.conf
 endef
 
index 1df0c676f795ece4a53c311e5626b85246e460fc..5ba984670beee50bf9eda03815796acdcb9c48a7 100644 (file)
@@ -20,8 +20,6 @@ PKG_CAT:=zcat
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-PKG_INIT_PRIO:=60
-
 include $(INCLUDE_DIR)/package.mk
 
 define Package/asterisk/Default
@@ -392,7 +390,7 @@ define Package/asterisk/install
        install -m0644  ./files/asterisk.default $(1)/etc/default/asterisk
        install -d -m0755 $(1)/etc/init.d
        install -m0755  ./files/asterisk.init $(1)/etc/init.d/asterisk
-       ln -sf asterisk $(1)/etc/init.d/S60asterisk
+       ln -sf asterisk $(1)/etc/init.d/asterisk
 endef
 
 define Package/asterisk-mini/install
@@ -418,7 +416,7 @@ define Package/asterisk-mini/install
        install -m0644  ./files/asterisk.default $(1)/etc/default/asterisk
        install -d -m0755 $(1)/etc/init.d
        install -m0755  ./files/asterisk.init $(1)/etc/init.d/asterisk
-       ln -sf asterisk $(1)/etc/init.d/S$(PKG_INIT_PRIO)asterisk
+       ln -sf asterisk $(1)/etc/init.d/asterisk
 endef
 
 define Package/asterisk-mysql/install
index 698c3dfa825a69130f892d825a7f880ec477f0a0..1c97a18dfae943d3dcde1065e06951a98bf9650d 100644 (file)
@@ -1,23 +1,17 @@
-#!/bin/sh
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
 
 DEFAULT=/etc/default/asterisk
 OPTIONS=""
-[ -f $DEFAULT ] && . $DEFAULT
-[ "$ENABLE_ASTERISK" = "yes" ] || exit 0
 
-case $1 in
- start)
-  [ -d /var/run ] || mkdir -p /var/run
-  [ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk
-  [ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
-  /usr/sbin/asterisk $OPTIONS
-  ;;
- stop)
-  [ -f /var/run/asterisk.pid ] && kill $(cat /var/run/asterisk.pid) >/dev/null 2>&1
-  ;;
- *)
-  echo "usage: $0 (start|stop)"
-  exit 1
-esac
+start() {
+       [ -f $DEFAULT ] && . $DEFAULT
+       [ -d /var/run ] || mkdir -p /var/run
+       [ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk
+       [ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
+       /usr/sbin/asterisk $OPTIONS
+}
 
-exit $?
+stop() {
+       [ -f /var/run/asterisk.pid ] && kill $(cat /var/run/asterisk.pid) >/dev/null 2>&1
+}
index 808949e98f4c54c528ce46bc2713d07b671cc9f0..19812c408a462ceef4fd68720912f9283de81717 100644 (file)
@@ -118,7 +118,7 @@ define Package/bind-server/install
        install -d -m0755 $(1)/etc/init.d
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
        $(CP) files/bind $(1)/etc
-       $(CP) files/named.init $(1)/etc/init.d/S$(PKG_INIT_LEVEL)named
+       $(CP) files/named.init $(1)/etc/init.d/named
        find $(1)/etc/bind -name ".svn" | xargs rm -rf
 endef
 
index a355e70ef5448781993d1786060e2195436ce879..bfd6370d8157dd369defb0218af329e39aa4784a 100644 (file)
@@ -61,14 +61,14 @@ define Build/Compile
        $(CP) $(PKG_BUILD_DIR)/translation $(PKG_INSTALL_DIR)/usr/lib/bx/
        bzip2 $(PKG_INSTALL_DIR)/usr/lib/bx/translation/*
        $(CP) ./files/bitchxrc $(PKG_INSTALL_DIR)/tmp/.bitchxrc
-       $(CP) ./files/S98bitchxrc $(PKG_INSTALL_DIR)/etc/init.d/S98bitchxrc
+       $(CP) ./files/bitchxrc.init $(PKG_INSTALL_DIR)/etc/init.d/bitchxrc
 endef
 
 define Package/bitchx/install
        install -m0755 -d $(1)/usr/bin $(1)/usr/lib $(1)/etc/init.d $(1)/tmp
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/etc/init.d/S98bitchxrc $(1)/etc/init.d/
+       $(CP) $(PKG_INSTALL_DIR)/etc/init.d/bitchxrc $(1)/etc/init.d/
        $(CP) $(PKG_INSTALL_DIR)/tmp/.bitchxrc $(1)/tmp
 endef
 
diff --git a/net/bitchx/files/S98bitchxrc b/net/bitchx/files/S98bitchxrc
deleted file mode 100755 (executable)
index eda8a03..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-start() {
-       # make /tmp/.bitchxrc as many servers ban root
-       if [ ! -e /tmp/.bitchxrc ]
-       then
-               echo "IRCUSER OpenWrt" >/tmp/.bitchxrc
-               echo "IRCNAME OpenWrt User!" >>/tmp/.bitchxrc
-       fi
-}
diff --git a/net/bitchx/files/bitchxrc.init b/net/bitchx/files/bitchxrc.init
new file mode 100755 (executable)
index 0000000..e5966d3
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh /etc/rc.common
+
+START=98
+start() {
+       # make /tmp/.bitchxrc as many servers ban root
+       if [ ! -e /tmp/.bitchxrc ]
+       then
+               echo "IRCUSER OpenWrt" >/tmp/.bitchxrc
+               echo "IRCNAME OpenWrt User!" >>/tmp/.bitchxrc
+       fi
+}
index de6ede36d164d47276659f9900dc47749499beee..ad7ee36f82d9fcda0d13ca2dbffb8af90e7aa795 100644 (file)
@@ -38,7 +38,6 @@ endef
 define Package/bitlbee/conffiles
 /etc/bitlbee/motd.txt
 /etc/bitlbee/bitlbee.conf
-/etc/init.d/S55bitlbee
 endef
 
 define Build/Configure
@@ -81,7 +80,7 @@ define Package/bitlbee/install
        $(MAKE) -C $(PKG_BUILD_DIR)/doc/user-guide \
                DESTDIR="$(1)" install 
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/S55bitlbee $(1)/etc/init.d/S55bitlbee
+       install -m0755 ./files/bitlbee.init $(1)/etc/init.d/bitlbee
 endef
 
 $(eval $(call BuildPackage,bitlbee))
diff --git a/net/bitlbee/files/S55bitlbee b/net/bitlbee/files/S55bitlbee
deleted file mode 100755 (executable)
index 95c5f59..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-
-start() {
-       mkdir -p /var/lib/bitlbee
-       bitlbee -D
-}
-
-stop() {
-       killall bitlbee
-}
diff --git a/net/bitlbee/files/bitlbee.init b/net/bitlbee/files/bitlbee.init
new file mode 100755 (executable)
index 0000000..95c5f59
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+       mkdir -p /var/lib/bitlbee
+       bitlbee -D
+}
+
+stop() {
+       killall bitlbee
+}
index 4e88b31ac283180ca47a12f1f9a3387c7f595ed3..cfa49e835431153674ae89a5a7cce049d4b4c04e 100644 (file)
@@ -98,7 +98,7 @@ define Package/roofnet/install
        $(CP) $(PKG_BUILD_DIR)/conf/wifi/read_handler $(1)/usr/bin
        $(CP) $(PKG_BUILD_DIR)/conf/wifi/write_handler $(1)/usr/bin
        mkdir -p $(1)/etc/init.d
-       install -m 755 ./files/S50roofnet $(1)/etc/init.d/
+       install -m 755 ./files/roofnet.init $(1)/etc/init.d/roofnet
 endef
 
 $(eval $(call BuildPackage,click))
diff --git a/net/click/files/S50roofnet b/net/click/files/S50roofnet
deleted file mode 100755 (executable)
index 256e2ab..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-
-start() {
-       killall -q click
-       cp /usr/bin/srcr.click /tmp
-       sh /usr/bin/gen_config_roofnet.sh > /tmp/unaligned.click
-       click-align /tmp/unaligned.click > /tmp/roofnet.click
-       /usr/bin/click /tmp/roofnet.click > /tmp/roofnet.log 2>&1 &
-}
-
-stop() {
-       killall click
-}
diff --git a/net/click/files/roofnet.init b/net/click/files/roofnet.init
new file mode 100755 (executable)
index 0000000..256e2ab
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+       killall -q click
+       cp /usr/bin/srcr.click /tmp
+       sh /usr/bin/gen_config_roofnet.sh > /tmp/unaligned.click
+       click-align /tmp/unaligned.click > /tmp/roofnet.click
+       /usr/bin/click /tmp/roofnet.click > /tmp/roofnet.log 2>&1 &
+}
+
+stop() {
+       killall click
+}
index 3e51a83226f5486c4910fbe288f1fe4ac9bdf961..a8852985efc56faa5a64cad15ba012dc2eee0fca 100644 (file)
@@ -96,7 +96,7 @@ define Package/cups/install
        $(CP) ./files/etc/cups/* $(1)/etc/cups/
        # install initscript with priority 60
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/cupsd.init $(1)/etc/init.d/S60cupsd
+       install -m0755 ./files/cupsd.init $(1)/etc/init.d/cupsd
 endef
 
 define Build/InstallDev
index cfb2ff8b119abbe1ceacca1ec07f22a4650adb5c..4b5cdcee6a3315338aa507b1a3b49e9d95e84167 100644 (file)
@@ -5,9 +5,9 @@ DEFAULT=/etc/default/radiusd
 LOG_D=/var/log/radius
 RUN_D=/var/run
 PID_F=$RUN_D/radiusd.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        [ -d $LOG_D ] || mkdir -p $LOG_D
        [ -d $RUN_D ] || mkdir -p $RUN_D
        radiusd $OPTIONS
index 71ffa8d235821b3439848a25d3a6826e21ac510c..f9e3705caaeb9c04bc1f4a80f7352efad01e0bd0 100644 (file)
@@ -5,9 +5,9 @@ BIN=gmediaserver
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        $BIN $OPTIONS
 }
 
index 05354c68ba35c2530c9faabc52c0cd91f4fc7ba0..61449f91e4fdac340f30f15f1bf7a93fdf5f0051 100644 (file)
@@ -45,7 +45,7 @@ define Package/htpdate/install
        install -m0644 ./files/htpdate.default $(1)/etc/default/htpdate
        install -d -m0755 $(1)/etc/init.d/
        install -m0755 ./files/htpdate.init $(1)/etc/init.d/htpdate
-       ln -sf htpdate $(1)/etc/init.d/S49htpdate
+       ln -sf htpdate $(1)/etc/init.d/htpdate
        install -d -m0755 $(1)/usr/sbin
        install -m0755 $(PKG_BUILD_DIR)/htpdate $(1)/usr/sbin/
 endef
index 97ec97d4f79294ce41b7a002b9f1aba7b99b793b..1409321df9c56f6707b04701a2cc5cc5b436fb6c 100644 (file)
@@ -1,13 +1,14 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
+START=49
 BIN=htpdate
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $RUN_D
        $BIN -l -s -t $OPTIONS && $BIN -D $OPTIONS
 }
index eeecae51d1b55b1881bb18a5bab3f0da2723157b..7549c1981abffec36154b941464251a95aec6f09 100644 (file)
@@ -1,13 +1,14 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
+START=60
 BIN=l2tpd
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        $BIN $OPTIONS
 }
 
index 3e46924e83601935423736033583de0ee541a9d5..fe0ca2290c2a6deb1bb499112431b9afb41740ba 100644 (file)
@@ -6,9 +6,9 @@ DEFAULT=/etc/default/$BIN
 LOG_D=/var/log/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $LOG_D
        mkdir -p $RUN_D
        $BIN $OPTIONS
index d807ad39c6ba91f2d37109f4182afb713ea4a899..79ea02c8be1fd473014dbb85d169cf3d995c2865 100644 (file)
@@ -61,7 +61,7 @@ define Package/maradns/install
        install -d -m0755 $(1)/etc
        install -m0644 ./files/mararc $(1)/etc/mararc
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/maradns.init $(1)/etc/init.d/S60maradns
+       install -m0755 ./files/maradns.init $(1)/etc/init.d/maradns
        install -d -m0755 $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/{askmara,getzone,fetchzone,duende} $(1)/usr/bin/
        install -d -m0755 $(1)/usr/sbin
index 3afa9de2eaaea76ed5b4113e18f41255b49c6744..5b59cb0d0e58ffc7ff576459d0229939d5543421 100644 (file)
@@ -53,7 +53,7 @@ define Package/miau/install
        install -d -m0755 $(1)/etc/init.d
        install -d -m0755 $(1)/etc/default
        install -d -m0755 $(1)/etc/miau
-       install -m0755 ./files/S50miau $(1)/etc/init.d/S50miau
+       install -m0755 ./files/miau.init $(1)/etc/init.d/miau
        install -m0644 ./files/miau $(1)/etc/default/miau
        install -m0644 ./files/miaurc $(1)/etc/miau/miaurc
 endef
diff --git a/net/miau/files/S50miau b/net/miau/files/S50miau
deleted file mode 100755 (executable)
index 892c23c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-
-DEFAULT="/etc/default/miau"
-OPTIONS="-d /etc/miau/"
-LOG_DIR="/var/log/miau"
-ERR_LOG="$LOG_DIR/error.log"
-OUT_LOG="$LOG_DIR/miau.log"
-
-start() {
-       [ -f $DEFAULT ] && . $DEFAULT
-       [ "$ENABLE_MIAU" = "yes" ] || exit 0
-       [ -f /var/run/miau.pid ] && {
-               echo "[ERROR] miau is running"
-               exit 0
-       }
-       [ -d $LOG_DIR ] || mkdir -p $LOG_DIR 
-       /usr/bin/miau -f $OPTIONS > $OUT_LOG 2> $ERR_LOG &
-       PID=$!
-       sleep 1 
-       if [ -d /proc/$PID ]; then
-               echo $PID > /var/run/miau.pid 
-       else 
-               echo "[ERROR] Unable to run miau as a daemon"
-       fi
-}
-
-stop() {
-       [ -f /var/run/miau.pid ] && kill $(cat /var/run/miau.pid) >/dev/null 2>&1 && rm /var/run/miau.pid
-}
diff --git a/net/miau/files/miau.init b/net/miau/files/miau.init
new file mode 100755 (executable)
index 0000000..892c23c
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+DEFAULT="/etc/default/miau"
+OPTIONS="-d /etc/miau/"
+LOG_DIR="/var/log/miau"
+ERR_LOG="$LOG_DIR/error.log"
+OUT_LOG="$LOG_DIR/miau.log"
+
+start() {
+       [ -f $DEFAULT ] && . $DEFAULT
+       [ "$ENABLE_MIAU" = "yes" ] || exit 0
+       [ -f /var/run/miau.pid ] && {
+               echo "[ERROR] miau is running"
+               exit 0
+       }
+       [ -d $LOG_DIR ] || mkdir -p $LOG_DIR 
+       /usr/bin/miau -f $OPTIONS > $OUT_LOG 2> $ERR_LOG &
+       PID=$!
+       sleep 1 
+       if [ -d /proc/$PID ]; then
+               echo $PID > /var/run/miau.pid 
+       else 
+               echo "[ERROR] Unable to run miau as a daemon"
+       fi
+}
+
+stop() {
+       [ -f /var/run/miau.pid ] && kill $(cat /var/run/miau.pid) >/dev/null 2>&1 && rm /var/run/miau.pid
+}
index b050b5572b03b366cfea11117e3132d82982bcb7..d8c3d4c305669f30bb77e498b9c3c7a46efa9606 100644 (file)
@@ -5,9 +5,9 @@ BIN=miredo-server
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        [ -d $RUN_D ] || mkdir -p $RUN_D
        insmod ipv6
        insmod tun
index 7fe13d963fbf9f9668001ee0dbaa96882bbb031a..dbf46a6d6c4a93d143ff710697bdf21bd649e027 100644 (file)
@@ -5,9 +5,9 @@ BIN=miredo
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        [ -d $RUN_D ] || mkdir -p $RUN_D
        insmod ipv6
        insmod tun
index 134d3d54860fba270f2fd5a22c8f3de86673970b..add3136d663373b497e6061af613b158ac2c2f70 100644 (file)
@@ -41,7 +41,7 @@ endef
 
 define Package/netperf/install 
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/netserver.init $(1)/etc/init.d/S51netserver
+       install -m0755 ./files/netserver.init $(1)/etc/init.d/netserver
        install -d -m0755 $(1)/usr/bin
        install -m0755 $(PKG_BUILD_DIR)/netperf $(1)/usr/bin/
        install -m0755 $(PKG_BUILD_DIR)/netserver $(1)/usr/bin/
index cae589f6799de87da65adc1f17a1ad279152a147..b16107a99a740c8a24edaa6d6c45d6171e359da7 100644 (file)
@@ -55,7 +55,7 @@ endef
 define Package/nfs-kernel-server/install
        install -d -m755 $(1)/etc/init.d $(1)/usr/sbin
        install -m0644 ./files/nfsd.exports $(1)/etc/exports
-       install -m0755 ./files/nfsd.init $(1)/etc/init.d/S60nfsd
+       install -m0755 ./files/nfsd.init $(1)/etc/init.d/nfsd
        install -m0755 $(PKG_BUILD_DIR)/utils/lockd/lockd $(1)/usr/sbin/rpc.lockd
        install -m0755 $(PKG_BUILD_DIR)/utils/statd/statd $(1)/usr/sbin/rpc.statd
        install -m0755 $(PKG_BUILD_DIR)/utils/nfsd/nfsd $(1)/usr/sbin/rpc.nfsd
index 21adf5b2919cc0a06da84d1c3521412c8dd65e15..cb4bae5f6af611d5034137771312cb8ad54b9136 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
+START=60
 NFS_D=/var/lib/nfs
 
 start() {
index 3132f12dc0640c75bf363a8192a46e2f9ddf8d02..c66aa373ca9fe97ebf318808128e59f3ad4408af 100644 (file)
@@ -38,7 +38,7 @@ define Package/nfs-server/install
        install -d -m0755 $(1)/etc
        install -m0644 ./files/nfsd.exports $(1)/etc/exports
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/nfsd.init $(1)/etc/init.d/S60nfsd
+       install -m0755 ./files/nfsd.init $(1)/etc/init.d/nfsd
        install -d -m0755 $(1)/usr/sbin
        install -m0755 $(PKG_BUILD_DIR)/rpc.* $(1)/usr/sbin/
 endef
index 64a8305b15844b38b0e3c7c9f3b7e0950052bdac..b951305ce1d6b90dbb062ab6f1002f030a6e8371 100644 (file)
@@ -44,7 +44,7 @@ define Package/oidentd/install
        install -m0755 -d $(1)/usr/sbin
        install -m0755 -d $(1)/etc/init.d
        $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(1)/usr/sbin/
-       $(CP) ./files/S85oidentd $(1)/etc/init.d
+       $(CP) ./files/oidentd.init $(1)/etc/init.d/oidentd
 endef
 
 $(eval $(call BuildPackage,oidentd))
diff --git a/net/oidentd/files/S85oidentd b/net/oidentd/files/S85oidentd
deleted file mode 100755 (executable)
index a2c04b7..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-
-start() {
-       /usr/sbin/oidentd -m -f 113
-}
-
-stop() {
-       killall oidentd
-}
diff --git a/net/oidentd/files/oidentd.init b/net/oidentd/files/oidentd.init
new file mode 100755 (executable)
index 0000000..2bdc34d
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+START=85
+start() {
+       /usr/sbin/oidentd -m -f 113
+}
+
+stop() {
+       killall oidentd
+}
index d9b9c8c4f1e785a826f687ea8ca3b1d4452b44cd..ea857700bcaddce677b526a0335cc9a7a30a0113 100644 (file)
@@ -109,7 +109,7 @@ define Package/olsrd/install
        install -d -m0755 $(1)/usr/sbin
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/olsrd $(1)/usr/sbin/
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/olsrd.init $(1)/etc/init.d/S60olsrd
+       install -m0755 ./files/olsrd.init $(1)/etc/init.d/olsrd
 endef
 
 define Package/olsrd-mod-dot-draw/install
index f59ff7ef88271ca672dba2c4bea170ade4627e1d..3cdd6ae1597ae42340aee08944956c60c2a008a4 100644 (file)
@@ -2,9 +2,9 @@
 # Copyright (C) 2006 OpenWrt.org
 
 DEFAULT=/etc/default/olsrd
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        olsrd $OPTIONS
 }
 
index 35c199431935cac381cdf5a953811683788ea1e0..0f859b3914c5d436885bb730cd411c913e460740 100644 (file)
@@ -90,7 +90,7 @@ define Package/openntpd/install
        install -d -m0755 $(1)/etc
        install -m0644 ./files/ntpd.conf $(1)/etc/
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/ntpd.init $(1)/etc/init.d/S55ntpd
+       install -m0755 ./files/ntpd.init $(1)/etc/init.d/ntpd
        install -d -m0755 $(1)/usr/sbin/
        install -m0755 $(PKG_BUILD_DIR)/ntpd $(1)/usr/sbin/
 endef
index e680f62c3564328738c31d8a18020b779ae7daf3..2fc4bb8adf93b4d3720bd8792c951183c291ed9e 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
+START=60
 start() {
        mkdir -p `awk -F: '/^ntp:/{print $6}' /etc/passwd`
        /usr/sbin/ntpd -s
index 32a63594632b00972854e9389d584f6c8fb55b27..de806a5b42b2f82e43c2fdf95346af6b43cd1976 100644 (file)
@@ -152,7 +152,7 @@ define Package/openssh-server/install
        chmod 0700 $(1)/etc/ssh
        $(CP) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
        install -m0755 -d $(1)/etc/init.d
-       install -m0755 ./files/S50sshd $(1)/etc/init.d/
+       install -m0755 ./files/sshd.init $(1)/etc/init.d/sshd
        install -m0755 -d $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/ssh-keygen $(1)/usr/bin/
        install -m0755 -d $(1)/usr/sbin
diff --git a/net/openssh/files/S50sshd b/net/openssh/files/S50sshd
deleted file mode 100755 (executable)
index c2e535d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-
-start() {
-       for type in rsa dsa; do {
-               # check for keys
-               key=/etc/ssh/ssh_host_${type}_key
-               [ ! -f $key ] && {
-                       # generate missing keys
-                       [ -x /usr/bin/ssh-keygen ] && {
-                               /usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&- && exec $0 $*
-                       } &
-                       exit 0
-               }
-       }; done
-       mkdir -p /var/empty
-       /usr/sbin/sshd
-}
-
-stop() {
-       killall sshd
-}
diff --git a/net/openssh/files/sshd.init b/net/openssh/files/sshd.init
new file mode 100755 (executable)
index 0000000..c2e535d
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+       for type in rsa dsa; do {
+               # check for keys
+               key=/etc/ssh/ssh_host_${type}_key
+               [ ! -f $key ] && {
+                       # generate missing keys
+                       [ -x /usr/bin/ssh-keygen ] && {
+                               /usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&- && exec $0 $*
+                       } &
+                       exit 0
+               }
+       }; done
+       mkdir -p /var/empty
+       /usr/sbin/sshd
+}
+
+stop() {
+       killall sshd
+}
index 87e04d445386acf524d1f41302a17389e6c97f99..a023d6d0cedcd579daf0e2666bf5189757fb9b85 100644 (file)
@@ -56,7 +56,6 @@ define Package/p910nd/install
        install -d -m0755 $(1)/etc/init.d
        install -m0755 ./files/p910nd.init $(1)/etc/init.d/p910nd
        install -d -m0755 $(1)/usr/sbin
-       ln -sf p910nd $(1)/etc/init.d/S$(PKG_INIT_PRIO)p910nd
        install -m0755 $(PKG_BUILD_DIR)/p910nd $(1)/usr/sbin/
 endef
 
index 9fd309a8e396f3f3c740a8ea97bff5df41f5b1b7..d9456de56c31052c810776e299d2fd5a9a9e0234 100644 (file)
@@ -42,7 +42,6 @@ define Package/parprouted/install
        install -m0755 ./files/parprouted.default $(1)/etc/default/parprouted
        install -d -m0755 $(1)/etc/init.d
        install -m0755 ./files/parprouted.init $(1)/etc/init.d/parprouted
-       ln -sf parprouted $(1)/etc/init.d/S50parpouted
        install -d -m0755 $(1)/usr/sbin
        install -m0755 $(PKG_BUILD_DIR)/parprouted $(1)/usr/sbin/
 endef
index aae46fc68c85c0b0d36b69526d1594dbf087b087..b0911b6b885142231dbe5ce65b3970f6b40abd81 100755 (executable)
@@ -3,9 +3,9 @@
 
 BIN=parprouted
 DEFAULT=/etc/default/$BIN
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        $BIN $OPTIONS
 }
 
index cd786b89e9d73daabbd68e5ffd507173eb43bd46..45f151152259324fd54311d42cb54e8ace1f7b03 100644 (file)
@@ -3,11 +3,11 @@
 
 BIN=pgtext
 DEFAULT=/etc/default/$BIN
-[ -f $DEFAULT ] && . $DEFAULT
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN_${IF}_${ID}.pid
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        $BIN $OPTIONS
 }
 
index 05b19c4471daf3470217544ac6200a07a6cb212d..562ff291a841d57a06569120b22f95af81a959f8 100644 (file)
@@ -42,7 +42,6 @@ endef
 define Package/portmap/install 
        install -d -m0755 $(1)/etc/init.d 
        install -m0755 ./files/portmap.init $(1)/etc/init.d/portmap
-       ln -sf portmap $(1)/etc/init.d/S59portmap
        install -d -m0755 $(1)/usr/sbin 
        install -m0755 $(PKG_BUILD_DIR)/portmap $(1)/usr/sbin/
 endef
index fd4be7353534534794281ddfd05d343125e46d9c..3bbfb573f8c2239b48fd74d7f66fb52dd8613be5 100644 (file)
@@ -1,11 +1,12 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
+START=40
 BIN=portmap
 DEFAULT=/etc/default/$BIN
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        $BIN $OPTIONS
 }
 
index 0e5bb127f58179e3cc19070b92aa6eab9901ee57..49720240685113a9c18721645a4ae756465824e8 100644 (file)
@@ -49,7 +49,7 @@ define Package/pptpd/install
        install -d -m0755 $(1)/etc
        install -m0644 ./files/pptpd.conf $(1)/etc/
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/pptpd.init $(1)/etc/init.d/S50pptpd
+       install -m0755 ./files/pptpd.init $(1)/etc/init.d/pptpd
        install -d -m0755 $(1)/etc/ppp
        install -m0644 ./files/options.pptpd $(1)/etc/ppp/
        install -d -m0755 $(1)/usr/sbin
index 40e4d7e65abe3d4aeb0b1f18f208b0b7eaba316c..a74973ce2522fb6f07e32755b97e7d49841cef9a 100644 (file)
@@ -1,13 +1,14 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
+START=60
 BIN=pptpd
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $RUN_D
        for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async ppp_mppe_mppc; do
                insmod $m >/dev/null 2>&1
index eb733bcbef6e091d653f864fe59423646dee8e02..33bb2e17270238460f475c6f3bcaf189ee77f306 100644 (file)
@@ -124,8 +124,8 @@ define Package/quagga/install
        install -d -m0755 $(1)/etc/quagga/
        chmod 0750 $(1)/etc/quagga/
        install -d -m0755 $(1)/etc/init.d/
+       install -m0755 ./files/quagga $(1)/usr/sbin/quagga.init
        install -m0755 ./files/quagga.init $(1)/etc/init.d/quagga
-       ln -sf quagga $(1)/etc/init.d/S49quagga
        install -d -m0755 $(1)/var/run/quagga
 endef
 
diff --git a/net/quagga/files/quagga b/net/quagga/files/quagga
new file mode 100644 (file)
index 0000000..01f8d71
--- /dev/null
@@ -0,0 +1,333 @@
+#!/bin/sh
+#
+# quagga       Starts/stops quagga daemons and watchquagga.
+#              Create a daemon.conf file to have that routing daemon
+#              started/stopped automagically when using this script
+#              without any daemon names as args.
+#              If watchquagga is available, it will also be
+#              started/stopped if the script is called without
+#              any daemon names.
+#
+
+ME=$(basename $0)
+
+usage() {
+       echo "Usage: ${ME} {start|stop|restart} [daemon ...]"
+       exit 2
+}
+
+if [ -z "$1" ]
+then
+       usage
+else
+       COMMAND=$1
+fi
+shift
+ARG_DAEMONS=$*
+BINDIR=/usr/sbin
+CONFDIR=/etc/quagga
+STATEDIR=/var/run/quagga
+DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd"
+DAEMON_FLAGS=-d
+WATCHQUAGGA_FLAGS="-d -z -T 60 -R"
+WATCHQUAGGA_CMD="$0 watchrestart"
+if [ ${COMMAND} != "watchrestart" ]
+then
+       DAEMONS="${DAEMONS} watchquagga"
+fi
+DAEMONS_STARTSEQ=${DAEMONS}
+
+reverse()
+{
+       local revlist r
+        revlist=
+        for r
+       do
+                revlist="$r $revlist"
+        done
+        echo $revlist
+}
+
+DAEMONS_STOPSEQ=$(reverse ${DAEMONS_STARTSEQ})
+
+#pidof() {
+#      ps ax | awk 'match($5, "(^|/)'"$1"'$") > 0 { printf " %s", $1 }'
+#}
+
+quit() {
+       echo "${ME}: $1"
+       exit 0
+}
+
+die() {
+       echo "${ME}: $1"
+       exit 1
+}
+
+is_in() {
+       local i
+       for i in $2
+       do
+               [ "$1" = "$i" ] && return 0
+       done
+       return 1
+}
+
+select_subset() {
+       local unknown i j
+       unknown=
+       RESULT=
+       for i in $1
+       do
+               is_in $i "$2" || unknown="$unknown $i"
+       done
+       if [ -n "$unknown" ]
+       then
+               RESULT=$unknown
+               return 1
+       else
+               for j in $2
+               do
+                       is_in $j "$1" && RESULT="$RESULT $j"
+               done
+               return 0
+       fi
+}
+
+# check command
+
+case ${COMMAND}
+in
+       start|stop|restart)
+               ;;
+       watchrestart)
+               if [ -n "$ARG_DAEMONS" ]
+               then
+                       echo "${ME}: watchrestart mode is only for use by watchquagga"
+                       exit 2
+               fi
+               ;;
+       *)
+               usage
+               ;;
+esac
+
+# select daemons to start
+
+case ${COMMAND}
+in
+       start|restart|watchrestart)
+               START_DAEMONS=
+               for d in ${DAEMONS_STARTSEQ}
+               do
+                       [ -x "${BINDIR}/${d}" -a -f "${CONFDIR}/${d}.conf" ] \
+                       && START_DAEMONS="${START_DAEMONS}${d} "
+               done
+               WATCHQUAGGA_DAEMONS=${START_DAEMONS}
+               if is_in watchquagga "${DAEMONS_STARTSEQ}"
+               then
+                       START_DAEMONS="${START_DAEMONS} watchquagga"
+               fi
+               if [ -n "${ARG_DAEMONS}" ]
+               then
+                       if select_subset "${ARG_DAEMONS}" "${DAEMONS}"
+                       then
+                               if select_subset "${ARG_DAEMONS}" "${START_DAEMONS}"
+                               then
+                                       START_DAEMONS=${RESULT}
+                               else
+                                       die "these daemons are not startable:${RESULT}."
+                               fi
+                       else
+                               die "unknown daemons:${RESULT}; choose from: ${DAEMONS}."
+                       fi
+               fi
+               ;;
+esac
+
+# select daemons to stop
+
+case ${COMMAND}
+in
+       stop|restart|watchrestart)
+               STOP_DAEMONS=${DAEMONS_STOPSEQ}
+               if [ -n "${ARG_DAEMONS}" ]
+               then
+                       if select_subset "${ARG_DAEMONS}" "${STOP_DAEMONS}"
+                       then
+                               STOP_DAEMONS=${RESULT}
+                       else
+                               die "unknown daemons:${RESULT}; choose from: ${DAEMONS}."
+                       fi
+               fi
+               stop_daemons=
+               for d in ${STOP_DAEMONS}
+               do
+                       pidfile=${STATEDIR}/${d}.pid
+                       if [ -f "${pidfile}" -o -n "$(pidof ${d})" ]
+                       then
+                               stop_daemons="${stop_daemons}${d} "
+                       elif [ -n "${ARG_DAEMONS}" ]
+                       then
+                               echo "${ME}: found no ${d} process running."
+                       fi
+               done
+               STOP_DAEMONS=${stop_daemons}
+               ;;
+esac
+
+# stop daemons
+
+for d in $STOP_DAEMONS
+do
+       echo -n "${ME}: Stopping ${d} ... "
+       pidfile=${STATEDIR}/${d}.pid
+       if [ -f "${pidfile}" ]
+       then
+               file_pid=$(cat ${pidfile})
+               if [ -z "${file_pid}" ]
+               then
+                       echo -n "no pid file entry found ... "
+               fi
+       else
+               file_pid=
+               echo -n "no pid file found ... "
+       fi
+       proc_pid=$(pidof ${d})
+       if [ -z "${proc_pid}" ]
+       then
+               echo -n "found no ${d} process running ... "
+       else
+               count=0
+               notinpidfile=
+               for p in ${proc_pid}
+               do
+                       count=$((${count}+1))
+                       if kill ${p}
+                       then
+                               echo -n "killed ${p} ... "
+                       else
+                               echo -n "failed to kill ${p} ... "
+                       fi
+                       [ "${p}" = "${file_pid}" ] \
+                       || notinpidfile="${notinpidfile} ${p}"
+               done
+               [ ${count} -le 1 ] \
+               || echo -n "WARNING: ${count} ${d} processes were found running ... "
+               for n in ${notinpidfile}
+               do
+                       echo -n "WARNING: process ${n} was not in pid file ... "
+               done
+       fi
+       count=0
+       survivors=$(pidof ${d})
+       while [ -n "${survivors}" ]
+       do
+               sleep 1
+               count=$((${count}+1))
+               survivors=$(pidof ${d})
+               [ -z "${survivors}" -o ${count} -gt 5 ] && break
+               for p in ${survivors}
+               do
+                       sleep 1
+                       echo -n "${p} "
+                       kill ${p}
+               done
+       done
+       survivors=$(pidof ${d})
+       [ -n "${survivors}" ] && \
+       if kill -KILL ${survivors}
+       then
+               echo -n "KILLed ${survivors} ... "
+       else
+               echo -n "failed to KILL ${survivors} ... "
+       fi
+       sleep 1
+       survivors=$(pidof ${d})
+       if [ -z "${survivors}" ]
+       then
+               echo -n "done."
+               if [ -f "${pidfile}" ]
+               then
+                       rm -f ${pidfile} \
+                       || echo -n " Failed to remove pidfile."
+               fi
+       else
+               echo -n "failed to stop ${survivors} - giving up."
+               if [ "${survivors}" != "${file_pid}" ]
+               then
+                       if echo "${survivors}" > ${pidfile}
+                       then
+                               chown quagga:quagga ${pidfile}
+                               echo -n " Wrote ${survivors} to pidfile."
+                       else
+                               echo -n " Failed to write ${survivors} to pidfile."
+                       fi
+               fi
+       fi
+       echo
+done
+
+# start daemons
+
+if [ -n "$START_DAEMONS" ]
+then
+       [ -d ${CONFDIR} ] \
+       || quit "${ME}: no config directory ${CONFDIR} - exiting."
+       chown -R quagga:quagga ${CONFDIR}
+       [ -d ${STATEDIR} ] || mkdir -p ${STATEDIR} \
+       || die "${ME}: could not create state directory ${STATEDIR} - exiting."
+       chown -R quagga:quagga ${STATEDIR}
+
+       for d in $START_DAEMONS
+       do
+               echo -n "${ME}: Starting ${d} ... "
+               proc_pid=$(pidof ${d})
+               pidfile=${STATEDIR}/${d}.pid
+               file_pid=
+               if [ -f "${pidfile}" ]
+               then
+                       file_pid=$(cat ${pidfile})
+                       if [ -n "${file_pid}" ]
+                       then
+                               echo -n "found old pid file entry ${file_pid} ... "
+                       fi
+               fi
+               if [ -n "${proc_pid}" ]
+               then
+                       echo -n "found ${d} running (${proc_pid}) - skipping ${d}."
+                       if [ "${proc_pid}" != "${file_pid}" ]
+                       then
+                               if echo "${proc_pid}" > ${pidfile}
+                               then
+                                       chown quagga:quagga ${pidfile}
+                                       echo -n " Wrote ${proc_pid} to pidfile."
+                               else
+                                       echo -n " Failed to write ${proc_pid} to pidfile."
+                               fi
+                       fi
+               elif rm -f "${pidfile}"
+               then
+                       if [ "${d}" = "watchquagga" ]
+                       then
+                               $("${BINDIR}/${d}" \
+                                       ${WATCHQUAGGA_FLAGS} \
+                                       "${WATCHQUAGGA_CMD}" \
+                                       ${WATCHQUAGGA_DAEMONS})
+                               status=$?
+                       else
+                               $("${BINDIR}/${d}" ${DAEMON_FLAGS})
+                               status=$?
+                       fi
+                       if [ $status -eq 0 ]
+                       then
+                               echo -n "done."
+                       else
+                               echo -n "failed."
+                       fi
+               else
+                       echo -n " failed to remove pidfile."
+               fi
+               echo
+       done
+fi
index 01f8d7137d13b11a107bbd876539d8f5a98a8279..21fbf2c3abf65daa159c28e7c04f3c245a4a6c7b 100644 (file)
-#!/bin/sh
-#
-# quagga       Starts/stops quagga daemons and watchquagga.
-#              Create a daemon.conf file to have that routing daemon
-#              started/stopped automagically when using this script
-#              without any daemon names as args.
-#              If watchquagga is available, it will also be
-#              started/stopped if the script is called without
-#              any daemon names.
-#
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
 
-ME=$(basename $0)
-
-usage() {
-       echo "Usage: ${ME} {start|stop|restart} [daemon ...]"
-       exit 2
-}
-
-if [ -z "$1" ]
-then
-       usage
-else
-       COMMAND=$1
-fi
-shift
-ARG_DAEMONS=$*
-BINDIR=/usr/sbin
-CONFDIR=/etc/quagga
-STATEDIR=/var/run/quagga
-DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd"
-DAEMON_FLAGS=-d
-WATCHQUAGGA_FLAGS="-d -z -T 60 -R"
-WATCHQUAGGA_CMD="$0 watchrestart"
-if [ ${COMMAND} != "watchrestart" ]
-then
-       DAEMONS="${DAEMONS} watchquagga"
-fi
-DAEMONS_STARTSEQ=${DAEMONS}
-
-reverse()
-{
-       local revlist r
-        revlist=
-        for r
-       do
-                revlist="$r $revlist"
-        done
-        echo $revlist
-}
-
-DAEMONS_STOPSEQ=$(reverse ${DAEMONS_STARTSEQ})
-
-#pidof() {
-#      ps ax | awk 'match($5, "(^|/)'"$1"'$") > 0 { printf " %s", $1 }'
-#}
-
-quit() {
-       echo "${ME}: $1"
-       exit 0
-}
-
-die() {
-       echo "${ME}: $1"
-       exit 1
-}
-
-is_in() {
-       local i
-       for i in $2
-       do
-               [ "$1" = "$i" ] && return 0
-       done
-       return 1
+START=60
+start() {
+       /usr/sbin/quagga.init start
 }
 
-select_subset() {
-       local unknown i j
-       unknown=
-       RESULT=
-       for i in $1
-       do
-               is_in $i "$2" || unknown="$unknown $i"
-       done
-       if [ -n "$unknown" ]
-       then
-               RESULT=$unknown
-               return 1
-       else
-               for j in $2
-               do
-                       is_in $j "$1" && RESULT="$RESULT $j"
-               done
-               return 0
-       fi
+stop() {
+       /usr/sbin/quagga.init stop
 }
-
-# check command
-
-case ${COMMAND}
-in
-       start|stop|restart)
-               ;;
-       watchrestart)
-               if [ -n "$ARG_DAEMONS" ]
-               then
-                       echo "${ME}: watchrestart mode is only for use by watchquagga"
-                       exit 2
-               fi
-               ;;
-       *)
-               usage
-               ;;
-esac
-
-# select daemons to start
-
-case ${COMMAND}
-in
-       start|restart|watchrestart)
-               START_DAEMONS=
-               for d in ${DAEMONS_STARTSEQ}
-               do
-                       [ -x "${BINDIR}/${d}" -a -f "${CONFDIR}/${d}.conf" ] \
-                       && START_DAEMONS="${START_DAEMONS}${d} "
-               done
-               WATCHQUAGGA_DAEMONS=${START_DAEMONS}
-               if is_in watchquagga "${DAEMONS_STARTSEQ}"
-               then
-                       START_DAEMONS="${START_DAEMONS} watchquagga"
-               fi
-               if [ -n "${ARG_DAEMONS}" ]
-               then
-                       if select_subset "${ARG_DAEMONS}" "${DAEMONS}"
-                       then
-                               if select_subset "${ARG_DAEMONS}" "${START_DAEMONS}"
-                               then
-                                       START_DAEMONS=${RESULT}
-                               else
-                                       die "these daemons are not startable:${RESULT}."
-                               fi
-                       else
-                               die "unknown daemons:${RESULT}; choose from: ${DAEMONS}."
-                       fi
-               fi
-               ;;
-esac
-
-# select daemons to stop
-
-case ${COMMAND}
-in
-       stop|restart|watchrestart)
-               STOP_DAEMONS=${DAEMONS_STOPSEQ}
-               if [ -n "${ARG_DAEMONS}" ]
-               then
-                       if select_subset "${ARG_DAEMONS}" "${STOP_DAEMONS}"
-                       then
-                               STOP_DAEMONS=${RESULT}
-                       else
-                               die "unknown daemons:${RESULT}; choose from: ${DAEMONS}."
-                       fi
-               fi
-               stop_daemons=
-               for d in ${STOP_DAEMONS}
-               do
-                       pidfile=${STATEDIR}/${d}.pid
-                       if [ -f "${pidfile}" -o -n "$(pidof ${d})" ]
-                       then
-                               stop_daemons="${stop_daemons}${d} "
-                       elif [ -n "${ARG_DAEMONS}" ]
-                       then
-                               echo "${ME}: found no ${d} process running."
-                       fi
-               done
-               STOP_DAEMONS=${stop_daemons}
-               ;;
-esac
-
-# stop daemons
-
-for d in $STOP_DAEMONS
-do
-       echo -n "${ME}: Stopping ${d} ... "
-       pidfile=${STATEDIR}/${d}.pid
-       if [ -f "${pidfile}" ]
-       then
-               file_pid=$(cat ${pidfile})
-               if [ -z "${file_pid}" ]
-               then
-                       echo -n "no pid file entry found ... "
-               fi
-       else
-               file_pid=
-               echo -n "no pid file found ... "
-       fi
-       proc_pid=$(pidof ${d})
-       if [ -z "${proc_pid}" ]
-       then
-               echo -n "found no ${d} process running ... "
-       else
-               count=0
-               notinpidfile=
-               for p in ${proc_pid}
-               do
-                       count=$((${count}+1))
-                       if kill ${p}
-                       then
-                               echo -n "killed ${p} ... "
-                       else
-                               echo -n "failed to kill ${p} ... "
-                       fi
-                       [ "${p}" = "${file_pid}" ] \
-                       || notinpidfile="${notinpidfile} ${p}"
-               done
-               [ ${count} -le 1 ] \
-               || echo -n "WARNING: ${count} ${d} processes were found running ... "
-               for n in ${notinpidfile}
-               do
-                       echo -n "WARNING: process ${n} was not in pid file ... "
-               done
-       fi
-       count=0
-       survivors=$(pidof ${d})
-       while [ -n "${survivors}" ]
-       do
-               sleep 1
-               count=$((${count}+1))
-               survivors=$(pidof ${d})
-               [ -z "${survivors}" -o ${count} -gt 5 ] && break
-               for p in ${survivors}
-               do
-                       sleep 1
-                       echo -n "${p} "
-                       kill ${p}
-               done
-       done
-       survivors=$(pidof ${d})
-       [ -n "${survivors}" ] && \
-       if kill -KILL ${survivors}
-       then
-               echo -n "KILLed ${survivors} ... "
-       else
-               echo -n "failed to KILL ${survivors} ... "
-       fi
-       sleep 1
-       survivors=$(pidof ${d})
-       if [ -z "${survivors}" ]
-       then
-               echo -n "done."
-               if [ -f "${pidfile}" ]
-               then
-                       rm -f ${pidfile} \
-                       || echo -n " Failed to remove pidfile."
-               fi
-       else
-               echo -n "failed to stop ${survivors} - giving up."
-               if [ "${survivors}" != "${file_pid}" ]
-               then
-                       if echo "${survivors}" > ${pidfile}
-                       then
-                               chown quagga:quagga ${pidfile}
-                               echo -n " Wrote ${survivors} to pidfile."
-                       else
-                               echo -n " Failed to write ${survivors} to pidfile."
-                       fi
-               fi
-       fi
-       echo
-done
-
-# start daemons
-
-if [ -n "$START_DAEMONS" ]
-then
-       [ -d ${CONFDIR} ] \
-       || quit "${ME}: no config directory ${CONFDIR} - exiting."
-       chown -R quagga:quagga ${CONFDIR}
-       [ -d ${STATEDIR} ] || mkdir -p ${STATEDIR} \
-       || die "${ME}: could not create state directory ${STATEDIR} - exiting."
-       chown -R quagga:quagga ${STATEDIR}
-
-       for d in $START_DAEMONS
-       do
-               echo -n "${ME}: Starting ${d} ... "
-               proc_pid=$(pidof ${d})
-               pidfile=${STATEDIR}/${d}.pid
-               file_pid=
-               if [ -f "${pidfile}" ]
-               then
-                       file_pid=$(cat ${pidfile})
-                       if [ -n "${file_pid}" ]
-                       then
-                               echo -n "found old pid file entry ${file_pid} ... "
-                       fi
-               fi
-               if [ -n "${proc_pid}" ]
-               then
-                       echo -n "found ${d} running (${proc_pid}) - skipping ${d}."
-                       if [ "${proc_pid}" != "${file_pid}" ]
-                       then
-                               if echo "${proc_pid}" > ${pidfile}
-                               then
-                                       chown quagga:quagga ${pidfile}
-                                       echo -n " Wrote ${proc_pid} to pidfile."
-                               else
-                                       echo -n " Failed to write ${proc_pid} to pidfile."
-                               fi
-                       fi
-               elif rm -f "${pidfile}"
-               then
-                       if [ "${d}" = "watchquagga" ]
-                       then
-                               $("${BINDIR}/${d}" \
-                                       ${WATCHQUAGGA_FLAGS} \
-                                       "${WATCHQUAGGA_CMD}" \
-                                       ${WATCHQUAGGA_DAEMONS})
-                               status=$?
-                       else
-                               $("${BINDIR}/${d}" ${DAEMON_FLAGS})
-                               status=$?
-                       fi
-                       if [ $status -eq 0 ]
-                       then
-                               echo -n "done."
-                       else
-                               echo -n "failed."
-                       fi
-               else
-                       echo -n " failed to remove pidfile."
-               fi
-               echo
-       done
-fi
index 5f6778a712ba10cf349bfeb737067583f61de38c..2ee47a20d547fdf7428caaac61c11f8731ba560c 100644 (file)
@@ -21,8 +21,6 @@ PKG_CAT:=zcat
 
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-PKG_INIT_PRIO=51
-
 include $(INCLUDE_DIR)/package.mk
 
 define Package/radvd
@@ -81,7 +79,7 @@ define Package/radvd/install
        install -d -m0755 $(1)/etc
        install -m0644 ./files/radvd.conf $(1)/etc/radvd.conf
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/radvd.init $(1)/etc/init.d/S$(PKG_INIT_PRIO)radvd
+       install -m0755 ./files/radvd.init $(1)/etc/init.d/radvd
        install -d -m0755 $(1)/usr/sbin
        install -m 755 $(PKG_INSTALL_DIR)/usr/sbin/radvd $(1)/usr/sbin/
        install -m 755 $(PKG_INSTALL_DIR)/usr/sbin/radvdump $(1)/usr/sbin/
index 38b1023139a3c81ef0435a0128f96650fdf26a24..acaca47f42231d0acd1aaccdbc944c84ce87cf2e 100644 (file)
@@ -20,8 +20,6 @@ PKG_CAT:=zcat
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
-PKG_INIT_PRIO:=50
-
 include $(INCLUDE_DIR)/package.mk
 
 define Package/rarpd
@@ -60,7 +58,6 @@ define Package/rarpd/install
        install -m644 ./files/rarpd.default $(1)/etc/default/rarpd
        install -d -m0755 $(1)/etc/init.d
        install -m755 ./files/rarpd.init $(1)/etc/init.d/rarpd
-       ln -sf rarpd $(1)/etc/init.d/S$(PKG_INIT_PRIO)rarpd
 endef
 
 $(eval $(call BuildPackage,rarpd))
index 353a96acb2203a92f3dce1a83be46b20aefbedb5..bba2c858e2ea044a8b476f7e09cd2b43726d485f 100644 (file)
@@ -3,9 +3,9 @@
 
 RARPD=/usr/sbin/rarpd
 DEFAULT=/etc/default/rarpd
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        $RARPD $OPTIONS
 }
 stop() {
index bdf4bc5d059f7754849d4699f76a655ecaf0aac6..38468716332a6a1340bd0093e98771c74602c3af 100644 (file)
@@ -42,7 +42,6 @@ endef
 define Package/reaim/install   
        install -d -m0755 $(1)/etc/init.d
        install -m0755 ./files/reaim.init $(1)/etc/init.d/reaim
-       ln -sf reaim $(1)/etc/init.d/S63reaim
        install -d -m0755 $(1)/usr/sbin
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/reaim $(1)/usr/sbin/
 endef
index 8fe8c50f33703c7da21e39ca7f6307562b035e8d..d6e8cb72d34f6febaadd49efa70ebfebb3cdaae1 100644 (file)
@@ -1,16 +1,17 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
+START=60
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 NAME=reaim
 DESC="Transparent proxy for IM behind NAT"
 IPT=/usr/sbin/iptables
 
-include /lib/network
-scan_interfaces
-config_get WAN wan ifname
-
 set_rules() {
+       include /lib/network
+       scan_interfaces
+       config_get WAN wan ifname
+
        [ -z "$WAN" ] && exit
        $IPT $1 input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT
        $IPT $1 input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT
index 8051cfd596fea2d41a7c1e903e6684654ddc09d5..4895e179438a83bbe92f4581c31e6bcd3fc3a4f1 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
+START=60
 DEFAULT=/etc/default/rp-l2tpd
 RUN_D=/var/run
 [ -f $DEFAULT ] && . $DEFAULT
index 53878c3026279cbb18129239b3ef1d88d8033047..21e0c44c8590d63f3d573c81b96fdf0fab62508e 100644 (file)
@@ -2,9 +2,9 @@
 # Copyright (C) 2006 OpenWrt.org
 
 DEFAULT=/etc/default/pppoe-relay
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        pppoe-relay $OPTIONS
 }
 
index b25f61974dfc38f6601f08190e75b64e903deb33..5e24be21fa167e1bcb547edce007c86478ae1782 100644 (file)
@@ -2,9 +2,9 @@
 # Copyright (C) 2006 OpenWrt.org
 
 DEFAULT=/etc/default/pppoe-server
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        pppoe-server $OPTIONS
 }
 
index a30dfcf46ef8a4cb82846b37ff3a1f247907d35a..504ce8a6052d43663ab1b3e3a9f34673f3883f70 100644 (file)
@@ -5,9 +5,9 @@ DEFAULT=/etc/default/samba
 RUN_D=/var/run/samba
 NMBD_PID_F=$RUN_D/nmbd.pid
 SMBD_PID_F=$RUN_D/smbd.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $RUN_D
        nmbd -D $NMBD_OPTIONS
        smbd -D $SMBD_OPTIONS
index dcdc4c39be50aa4c10204c4f32cd8d3a9f4f3e9d..573ff668d3fc4276d0097efff7a4d7ee373b2545 100644 (file)
@@ -60,7 +60,6 @@ define Package/scanlogd/install
        install -m0755 $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
        install -d -m0755 $(1)/etc/init.d
        install -m0755 ./files/scanlogd.init $(1)/etc/init.d/scanlogd
-       ln -sf scanlogd $(1)/etc/init.d/S$(PKG_INIT_PRIO)scanlogd
 endef
 
 $(eval $(call BuildPackage,scanlogd))
index 32b2ca94f6fc7f2566c39c249c6eea32a31f62b7..9ae569b66cf49b119fd3692ee79a6acaea4cced8 100644 (file)
@@ -5,9 +5,9 @@ BIN=siproxd
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $RUN_D
        $BIN $OPTIONS
 }
index 595f37817d953faeac9204c8f7d094b9caf6faac..22c9c97b5710ee6ac2af089e602abd4c512db6cd 100644 (file)
@@ -19,7 +19,6 @@ PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
-PKG_INIT_LEVEL:=60
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -42,10 +41,9 @@ endef
 define Package/srelay/install  
        install -m0755 -d $(1)/usr/bin
        install -m0755 -d $(1)/etc/init.d
-       $(CP) $(PKG_BUILD_DIR)/srelay $(1)/usr/bin/
-       $(CP) files/srelay.init $(1)/etc/init.d/S$(PKG_INIT_LEVEL)srelay
-       $(CP) files/srelay.conf $(1)/etc
-       chmod 755 $(1)/etc/init.d/S$(PKG_INIT_LEVEL)srelay
+       install -m0755 $(PKG_BUILD_DIR)/srelay $(1)/usr/bin/
+       install -m0755 files/srelay.init $(1)/etc/init.d/srelay
+       install -m0644 files/srelay.conf $(1)/etc
 endef
 
 $(eval $(call BuildPackage,srelay))
index 389c2385f98940d36a1e0c5cd79c9540468dbf81..1347bfc88dc3d21236df030ea43ed5cc107cb590 100644 (file)
@@ -5,11 +5,11 @@ BIN=tinyproxy
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
-        mkdir -p $RUN_D
-        $BIN $OPTIONS
+       [ -f $DEFAULT ] && . $DEFAULT
+    mkdir -p $RUN_D
+    $BIN $OPTIONS
 }
 
 stop() {
index 5de8663148a31c47d5cec932cef9b3a63a336a3c..b64fe8bd982b608270722d77ce6fbbdf4d565434 100644 (file)
@@ -6,9 +6,9 @@ DEFAULT=/etc/default/$BIN
 LOG_D=/var/log/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $LOG_D
        mkdir -p $RUN_D
        $BIN $OPTIONS
index 8d3d177482d4e148d56dd512e6fdbf6ed6b470bc..27f942ce0e934b80ab025502ee05baeaaf36df9f 100644 (file)
@@ -114,7 +114,6 @@ define Package/ulogd/install
        install -m0644 ./files/ulogd.default $(1)/etc/default/ulogd
        install -d -m0755 $(1)/etc/init.d
        install -m0755 ./files/ulogd.init $(1)/etc/init.d/ulogd
-       ln -sf ulogd $(1)/etc/init.d/S49ulogd
        install -d -m0755 $(1)/usr/lib/ulogd
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_BASE.so $(1)/usr/lib/ulogd/
        install -d -m0755 $(1)/usr/sbin
index 61a0879401108e321119c18e272e12680121c89d..cb7d08015d2542c64766bd6e0456a389374f4926 100644 (file)
@@ -4,9 +4,9 @@
 BIN=ulogd
 DEFAULT=/etc/default/$BIN
 LOG_D=/var/log
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        $BIN $OPTIONS
 }
 
index 100d6da53ac29c674ac2587cbd391176b204726d..79f220e1f5cabf66bd672bed8552a5f46a391e55 100644 (file)
@@ -29,7 +29,7 @@ define Package/updatedd
   TITLE:=A tool to update dynamic dns services
   DESCRIPTION:=Updatedd is a small tool that will update one of many dynamic\\\
   dns services on boot.\\\
-  Please look at the /etc/init.d/S55ddns script for more info.\\\
+  Please look at the /etc/init.d/ddns script for more info.\\\
   URL:=http://www.philipp-benner.de/updatedd/
 endef
 
@@ -112,7 +112,7 @@ endef
 
 define Package/updatedd/install
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/S55ddns $(1)/etc/init.d/
+       install -m0755 ./files/ddns.init $(1)/etc/init.d/ddns
        install -d -m0755 $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/updatedd $(1)/usr/bin/
        install -d -m0755 $(1)/usr/lib/updatedd
diff --git a/net/updatedd/files/S55ddns b/net/updatedd/files/S55ddns
deleted file mode 100644 (file)
index faaccb5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-
-start() {
-       . /etc/nvram.sh
-       
-       ddnsupdate=$(nvram get ddns_update)
-       [ "$ddnsupdate" = 1 ]&& {
-               service=$(nvram get ddns_service)
-               uname=$(nvram get ddns_user)
-               passwd=$(nvram get ddns_password)
-               host=$(nvram get ddns_host)
-       
-               /usr/bin/updatedd -Y $service -- $uname:$passwd $host
-       }
-}
-
-stop() {
-       killall updatedd
-}
diff --git a/net/updatedd/files/ddns.init b/net/updatedd/files/ddns.init
new file mode 100644 (file)
index 0000000..faaccb5
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+start() {
+       . /etc/nvram.sh
+       
+       ddnsupdate=$(nvram get ddns_update)
+       [ "$ddnsupdate" = 1 ]&& {
+               service=$(nvram get ddns_service)
+               uname=$(nvram get ddns_user)
+               passwd=$(nvram get ddns_password)
+               host=$(nvram get ddns_host)
+       
+               /usr/bin/updatedd -Y $service -- $uname:$passwd $host
+       }
+}
+
+stop() {
+       killall updatedd
+}
index 64d686f67c160554aabd73934f2c7318d5e0d997..ff6d53a5e9100cf958d04750d646c805fd9f3219 100644 (file)
@@ -3,11 +3,11 @@
 
 BIN=vrrpd
 DEFAULT=/etc/default/$BIN
-[ -f $DEFAULT ] && . $DEFAULT
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN_${IF}_${ID}.pid
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        $BIN $OPTIONS
 }
 
index 716f66d8fa4a9f695107ca4f431d2910b3bedeca..45e042141d56aa721db9bfbe3c1970964d7f4b90 100644 (file)
@@ -55,7 +55,7 @@ endef
        
 define Package/wifidog/install
        install -m0755 -d $(1)/etc/init.d
-       install -m0755 ./files/$(PKG_NAME).init $(1)/etc/init.d/S65wifidog
+       install -m0755 ./files/$(PKG_NAME).init $(1)/etc/init.d/wifidog
        install -m0644 ./files/wifidog.conf $(1)/etc/
        install -m0755 -d $(1)/usr/bin
        install -m0755 -d $(1)/usr/lib
index 40411926a5a938b8121a357a01ed9f57dd0390b4..8ca59b93f85128b517733d1135b4f4183d3e6b07 100644 (file)
@@ -4,9 +4,9 @@
 DEFAULT=/etc/default/xinetd
 RUN_D=/var/run
 PID_F=$RUN_D/xinetd.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        [ -d $RUN_D ] || mkdir -p $RUN_D
        xinetd $OPTIONS
 }
index 344621a41ae3545451b691d555f4c43f0e8d9652..460824ef6ca91734e0d080994a507b17f8a3ed6b 100644 (file)
@@ -5,9 +5,9 @@ BIN=mt-daapd
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       [ -f $DEFAULT ] && . $DEFAULT
        [ -d $RUN_D ] || mkdir -p $RUN_D
        $BIN $OPTIONS
 }
index 47c5a6bd2cfff6e6b99941cf3ea8d0b834be1224..71d0ce6a53c6d0513919c924d552156d84cd4a9e 100644 (file)
@@ -30,25 +30,25 @@ define Package/collectd
 endef
 
 define Build/Compile
-$(call Build/Configure/Default,--enable-shared \
---disable-static \
---disable-debug \
---enable-cpu \
---enable-load \
---enable-memory \
---enable-ping \
---enable-traffic \
---disable-cpufreq \
---disable-disk \
---disable-hddtemp \
---disable-nfs \
---disable-processes \
---disable-sensors \
---disable-serial \
---disable-swap \
---disable-tape \
---disable-users \
-)
+       $(call Build/Configure/Default,--enable-shared \
+               --disable-static \
+               --disable-debug \
+               --enable-cpu \
+               --enable-load \
+               --enable-memory \
+               --enable-ping \
+               --enable-traffic \
+               --disable-cpufreq \
+               --disable-disk \
+               --disable-hddtemp \
+               --disable-nfs \
+               --disable-processes \
+               --disable-sensors \
+               --disable-serial \
+               --disable-swap \
+               --disable-tape \
+               --disable-users \
+       )
 endef
 
 define Build/Compile
@@ -65,7 +65,7 @@ define Package/collectd/install
        install -d -m0755 $(1)/usr/lib/collectd
        install -d -m0755 $(1)/var/lib/collectd
        install -d -m0755 $(1)/var/run
-       install -m0755 ./files/S80collectd $(1)/etc/init.d/
+       install -m0755 ./files/collectd.init $(1)/etc/init.d/collectd
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/collectd/*.so $(1)/usr/lib/collectd/
 endef
diff --git a/utils/collectd/files/S80collectd b/utils/collectd/files/S80collectd
deleted file mode 100755 (executable)
index f35e4f5..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-
-BINARY="/usr/sbin/collectd"
-PIDFILE="/var/run/collectd.pid"
-DATADIR="/var/lib/collectd"
-
-start() {
-       [ -x "$BINARY" ] || exit 1;
-
-       if [ -e "$PIDFILE" ]
-       then
-               kill $(cat "$PIDFILE") 2>/dev/null
-               sleep 1
-       fi
-
-       [ -d "$DATADIR" ] || mkdir -p "$DATADIR";
-
-       $BINARY
-}
-
-stop() {
-       kill $(cat "$PIDFILE") 2>/dev/null
-}
diff --git a/utils/collectd/files/collectd.init b/utils/collectd/files/collectd.init
new file mode 100755 (executable)
index 0000000..34886f7
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+START=80
+BINARY="/usr/sbin/collectd"
+PIDFILE="/var/run/collectd.pid"
+DATADIR="/var/lib/collectd"
+
+start() {
+       [ -x "$BINARY" ] || exit 1;
+
+       if [ -e "$PIDFILE" ]
+       then
+               kill $(cat "$PIDFILE") 2>/dev/null
+               sleep 1
+       fi
+
+       [ -d "$DATADIR" ] || mkdir -p "$DATADIR";
+
+       $BINARY
+}
+
+stop() {
+       kill $(cat "$PIDFILE") 2>/dev/null
+}
index f0604d4326b7f380547b884e0d3e18d6456ded19..a38d07d740f6c07204aa302f09a11852dab52db7 100644 (file)
@@ -93,7 +93,7 @@ define Package/rrdcollect-example/install
        install -m0644 ./files/rrd.conf $(1)/etc/
        install -m0644 ./files/rrdcollect.conf $(1)/etc/
        install -d -m0755 $(1)/etc/init.d
-       install -m0755 ./files/rrdcollect.init $(1)/etc/init.d/S98rrdcollect
+       install -m0755 ./files/rrdcollect.init $(1)/etc/init.d/rrdcollect
        install -d -m0755 $(1)/usr/bin
        install -m0755 ./files/rrd.sh $(1)/usr/bin/
        install -d -m0755 $(1)/www/cgi-bin
index 8fa4521cb5ef3af273385939eba517c1d0c516d8..42943bd7171c7ce3c7ec93adf5523ca5377634de 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
+START=98
 BIN=rrdcollect
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
@@ -9,10 +10,10 @@ LIB_D=/var/lib/rrdcollect
 CGI_S=$LIB_D/rrd.cgi
 IMG_D=$LIB_D/img
 RRD_D=$LIB_D/rrd
-RRD_F=$(find $RRD_D -name "*.rrd" 2>/dev/null)
-[ -f $DEFAULT ] && . $DEFAULT
 
 start() {
+       RRD_F=$(find $RRD_D -name "*.rrd" 2>/dev/null)
+       [ -f $DEFAULT ] && . $DEFAULT
        mkdir -p $RUN_D
        mkdir -p $IMG_D
        mkdir -p $RRD_D
index 3dc820faca5404d5e78a3301b124c9ebb4ae8a32..7b87b95c376ddae6495b8be67682f53e689e7127 100644 (file)
@@ -18,8 +18,6 @@ PKG_SOURCE_URL:=@SF/setserial
 PKG_MD5SUM:=c4867d72c41564318e0107745eb7a0f2
 PKG_CAT:=zcat
 
-PKG_INIT_PRIO=15
-
 include $(INCLUDE_DIR)/package.mk
 
 define Package/setserial
@@ -69,7 +67,7 @@ endef
 define Package/setserial/install
        install -d -m0755 $(1)/etc/init.d
        install -m0755 ./files/serial.init $(1)/etc/init.d/setserial
-       ln -sf setserial $(1)/etc/init.d/S$(PKG_INIT_PRIO)setserial
+       ln -sf setserial $(1)/etc/init.d/setserial
        install -d -m0755 $(1)/usr/sbin
        install -m0755 $(PKG_BUILD_DIR)/setserial $(1)/usr/sbin/
 endef
index 77caae3a6dfbdcf47716e0b68d2acf5e9f31e9e4..f9cd0e84f74ef8ee6634ffdf3c572c9a356f4294 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
-start() {
+START=15
+boot() {
        /usr/sbin/setserial /dev/tts/1 irq 3
 }