From 6b00c90d709a01822027fb9986ec8ace605dd991 Mon Sep 17 00:00:00 2001 From: "\"Steven J. Hill\"" Date: Wed, 9 May 2007 22:48:41 +0000 Subject: Rename all INIT scripts to have the numerical prefixes to easily see the start-up order. --- package/dbus/S97messagebus | 76 ++++++++++++++++++++++++++++++++++ package/dbus/dbus.mk | 2 +- package/dbus/init-dbus | 76 ---------------------------------- package/dhcp/S80dhcp-relay | 53 ++++++++++++++++++++++++ package/dhcp/S80dhcp-server | 48 ++++++++++++++++++++++ package/dhcp/dhcp.mk | 4 +- package/dhcp/init-relay | 53 ------------------------ package/dhcp/init-server | 48 ---------------------- package/hal/S98haldaemon | 56 +++++++++++++++++++++++++ package/hal/hal.mk | 2 +- package/hal/init-hal | 56 ------------------------- package/ltt/S27tracer | 93 ++++++++++++++++++++++++++++++++++++++++++ package/ltt/init-tracer | 93 ------------------------------------------ package/ltt/ltt.mk | 2 +- package/netplug/S29netplug | 69 +++++++++++++++++++++++++++++++ package/netplug/init-netplug | 69 ------------------------------- package/netplug/netplug.mk | 2 +- package/nfs-utils/S60nfs | 89 ++++++++++++++++++++++++++++++++++++++++ package/nfs-utils/init-nfs | 89 ---------------------------------------- package/nfs-utils/nfs-utils.mk | 2 +- package/portmap/S13portmap | 44 ++++++++++++++++++++ package/portmap/init-portmap | 44 -------------------- package/portmap/portmap.mk | 2 +- package/proftpd/S50proftpd | 47 +++++++++++++++++++++ package/proftpd/init-proftpd | 47 --------------------- package/proftpd/proftpd.mk | 2 +- package/samba/S91smb | 79 +++++++++++++++++++++++++++++++++++ package/samba/init-samba | 79 ----------------------------------- package/samba/samba.mk | 2 +- package/sysklogd/S25syslog | 48 ++++++++++++++++++++++ package/sysklogd/init-syslog | 48 ---------------------- package/sysklogd/sysklogd.mk | 2 +- package/tftpd/S80tftpd-hpa | 81 ++++++++++++++++++++++++++++++++++++ package/tftpd/init-tftpd | 81 ------------------------------------ package/tftpd/tftpd.mk | 2 +- package/udev/S10udev | 81 ++++++++++++++++++++++++++++++++++++ package/udev/init-udev | 81 ------------------------------------ package/udev/udev.mk | 2 +- 38 files changed, 877 insertions(+), 877 deletions(-) create mode 100755 package/dbus/S97messagebus delete mode 100755 package/dbus/init-dbus create mode 100755 package/dhcp/S80dhcp-relay create mode 100755 package/dhcp/S80dhcp-server delete mode 100755 package/dhcp/init-relay delete mode 100755 package/dhcp/init-server create mode 100755 package/hal/S98haldaemon delete mode 100755 package/hal/init-hal create mode 100755 package/ltt/S27tracer delete mode 100755 package/ltt/init-tracer create mode 100755 package/netplug/S29netplug delete mode 100755 package/netplug/init-netplug create mode 100755 package/nfs-utils/S60nfs delete mode 100755 package/nfs-utils/init-nfs create mode 100755 package/portmap/S13portmap delete mode 100755 package/portmap/init-portmap create mode 100755 package/proftpd/S50proftpd delete mode 100755 package/proftpd/init-proftpd create mode 100755 package/samba/S91smb delete mode 100755 package/samba/init-samba create mode 100755 package/sysklogd/S25syslog delete mode 100755 package/sysklogd/init-syslog create mode 100755 package/tftpd/S80tftpd-hpa delete mode 100755 package/tftpd/init-tftpd create mode 100755 package/udev/S10udev delete mode 100755 package/udev/init-udev (limited to 'package') diff --git a/package/dbus/S97messagebus b/package/dbus/S97messagebus new file mode 100755 index 0000000000..bddb3b9dd1 --- /dev/null +++ b/package/dbus/S97messagebus @@ -0,0 +1,76 @@ +#!/bin/sh +# +# messagebus: The D-BUS systemwide message bus +# +# chkconfig: 345 97 03 +# description: This is a daemon which broadcasts notifications of system events \ +# and other messages. See http://www.freedesktop.org/software/dbus/ +# +# processname: dbus-daemon +# pidfile: /var/run/messagebus.pid +# + +# Sanity checks. +[ -x /usr/bin/dbus-daemon ] || exit 0 + +# Create needed directories. +[ -d /var/run/dbus ] || mkdir -p /var/run/dbus +[ -d /var/lock/subsys ] || mkdir -p /var/lock/subsys + +RETVAL=0 + +start() { + echo -n "Starting system message bus: " + + dbus-daemon --system + RETVAL=$? + echo "done" + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dbus-daemon +} + +stop() { + echo -n "Stopping system message bus: " + + ## we don't want to kill all the per-user $processname, we want + ## to use the pid file *only*; because we use the fake nonexistent + ## program name "$servicename" that should be safe-ish + killall dbus-daemon + RETVAL=$? + echo "done" + if [ $RETVAL -eq 0 ]; then + rm -f /var/lock/subsys/dbus-daemon + rm -f /var/run/messagebus.pid + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $processname + RETVAL=$? + ;; + restart) + stop + start + ;; + condrestart) + if [ -f /var/lock/subsys/$servicename ]; then + stop + start + fi + ;; + reload) + echo "Message bus can't reload its configuration, you have to restart it" + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" + ;; +esac +exit $RETVAL diff --git a/package/dbus/dbus.mk b/package/dbus/dbus.mk index 47210708f7..289811dda5 100644 --- a/package/dbus/dbus.mk +++ b/package/dbus/dbus.mk @@ -65,7 +65,7 @@ $(TARGET_DIR)/$(DBUS_TARGET_BINARY): $(STAGING_DIR)/usr/lib/libdbus-1.so rm -f $(TARGET_DIR)/usr/lib/libdbus-1.so -$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libdbus-1.so.3.2.0 $(MAKE) DESTDIR=$(TARGET_DIR) initddir=/etc/init.d -C $(DBUS_DIR)/bus install - $(INSTALL) -m 0755 -D package/dbus/init-dbus $(TARGET_DIR)/etc/init.d/S97messagebus + $(INSTALL) -m 0755 -D package/dbus/S97messagebus $(TARGET_DIR)/etc/init.d rm -f $(TARGET_DIR)/etc/init.d/messagebus rm -rf $(TARGET_DIR)/usr/man rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share diff --git a/package/dbus/init-dbus b/package/dbus/init-dbus deleted file mode 100755 index bddb3b9dd1..0000000000 --- a/package/dbus/init-dbus +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -# -# messagebus: The D-BUS systemwide message bus -# -# chkconfig: 345 97 03 -# description: This is a daemon which broadcasts notifications of system events \ -# and other messages. See http://www.freedesktop.org/software/dbus/ -# -# processname: dbus-daemon -# pidfile: /var/run/messagebus.pid -# - -# Sanity checks. -[ -x /usr/bin/dbus-daemon ] || exit 0 - -# Create needed directories. -[ -d /var/run/dbus ] || mkdir -p /var/run/dbus -[ -d /var/lock/subsys ] || mkdir -p /var/lock/subsys - -RETVAL=0 - -start() { - echo -n "Starting system message bus: " - - dbus-daemon --system - RETVAL=$? - echo "done" - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dbus-daemon -} - -stop() { - echo -n "Stopping system message bus: " - - ## we don't want to kill all the per-user $processname, we want - ## to use the pid file *only*; because we use the fake nonexistent - ## program name "$servicename" that should be safe-ish - killall dbus-daemon - RETVAL=$? - echo "done" - if [ $RETVAL -eq 0 ]; then - rm -f /var/lock/subsys/dbus-daemon - rm -f /var/run/messagebus.pid - fi -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status $processname - RETVAL=$? - ;; - restart) - stop - start - ;; - condrestart) - if [ -f /var/lock/subsys/$servicename ]; then - stop - start - fi - ;; - reload) - echo "Message bus can't reload its configuration, you have to restart it" - RETVAL=$? - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" - ;; -esac -exit $RETVAL diff --git a/package/dhcp/S80dhcp-relay b/package/dhcp/S80dhcp-relay new file mode 100755 index 0000000000..c870ea7f5d --- /dev/null +++ b/package/dhcp/S80dhcp-relay @@ -0,0 +1,53 @@ +#!/bin/sh +# +# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $ +# + + +# What servers should the DHCP relay forward requests to? +# e.g: SERVERS="192.168.0.1" +SERVERS="" + +# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests? +INTERFACES="" + +# Additional options that are passed to the DHCP relay daemon? +OPTIONS="" + + + + +# It is not safe to start if we don't have a default configuration... +echo "/etc/init.d/dhcp-relay not yet configured! - Aborting..." +exit 1; + + + +# Build command line for interfaces (will be passed to dhrelay below.) +IFCMD="" +if test "$INTERFACES" != ""; then + for I in $INTERFACES; do + IFCMD=${IFCMD}"-i "${I}" " + done +fi + +DHCRELAYPID=/var/run/dhcrelay.pid + +case "$1" in + start) + start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS + ;; + stop) + start-stop-daemon -K -x /usr/sbin/dhcrelay + ;; + restart | force-reload) + $0 stop + sleep 2 + $0 start + ;; + *) + echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}" + exit 1 +esac + +exit 0 diff --git a/package/dhcp/S80dhcp-server b/package/dhcp/S80dhcp-server new file mode 100755 index 0000000000..7c7f893a14 --- /dev/null +++ b/package/dhcp/S80dhcp-server @@ -0,0 +1,48 @@ +#!/bin/sh +# +# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $ +# + + + +# On what interfaces should the DHCP server (dhcpd) serve DHCP requests? +# Separate multiple interfaces with spaces, e.g. "eth0 eth1". +INTERFACES="" + + +# It is not safe to start if we don't have a default configuration... +echo "/etc/init.d/dhcp-server not yet configured! - Aborting..." +exit 1; + + + +test -f /usr/sbin/dhcpd || exit 0 + + +case "$1" in + start) + echo -n "Starting DHCP server: " + test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/ + test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases + start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES + echo "." + ;; + stop) + echo -n "Stopping DHCP server: dhcpd3" + start-stop-daemon -K -x /usr/sbin/dhcpd + echo "." + ;; + restart | force-reload) + $0 stop + sleep 2 + $0 start + if [ "$?" != "0" ]; then + exit 1 + fi + ;; + *) + echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}" + exit 1 +esac + +exit 0 diff --git a/package/dhcp/dhcp.mk b/package/dhcp/dhcp.mk index 75fd554b23..ec219e737f 100644 --- a/package/dhcp/dhcp.mk +++ b/package/dhcp/dhcp.mk @@ -43,7 +43,7 @@ $(DHCP_DIR)/$(DHCP_RELAY_BINARY): $(DHCP_DIR)/.configured $(TARGET_DIR)/$(DHCP_SERVER_TARGET_BINARY): $(DHCP_DIR)/$(DHCP_RELAY_BINARY) (cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp) $(INSTALL) -m 0755 -D $(DHCP_DIR)/$(DHCP_SERVER_BINARY) $(TARGET_DIR)/$(DHCP_SERVER_TARGET_BINARY) - $(INSTALL) -m 0755 -D package/dhcp/init-server $(TARGET_DIR)/etc/init.d/S80dhcp-server + $(INSTALL) -m 0755 -D package/dhcp/S80dhcp-server $(TARGET_DIR)/etc/init.d $(INSTALL) -m 0644 -D package/dhcp/dhcpd.conf $(TARGET_DIR)/etc/dhcp/dhcpd.conf rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \ $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc @@ -51,7 +51,7 @@ $(TARGET_DIR)/$(DHCP_SERVER_TARGET_BINARY): $(DHCP_DIR)/$(DHCP_RELAY_BINARY) $(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY): $(DHCP_DIR)/$(DHCP_RELAY_BINARY) (cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp) $(INSTALL) -m 0755 -D $(DHCP_DIR)/$(DHCP_RELAY_BINARY) $(TARGET_DIR)/$(DHCP_RELAY_TARGET_BINARY) - $(INSTALL) -m 0755 -D package/dhcp/init-relay $(TARGET_DIR)/etc/init.d/S80dhcp-relay + $(INSTALL) -m 0755 -D package/dhcp/S80dhcp-relay $(TARGET_DIR)/etc/init.d rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \ $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc diff --git a/package/dhcp/init-relay b/package/dhcp/init-relay deleted file mode 100755 index c870ea7f5d..0000000000 --- a/package/dhcp/init-relay +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# -# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $ -# - - -# What servers should the DHCP relay forward requests to? -# e.g: SERVERS="192.168.0.1" -SERVERS="" - -# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests? -INTERFACES="" - -# Additional options that are passed to the DHCP relay daemon? -OPTIONS="" - - - - -# It is not safe to start if we don't have a default configuration... -echo "/etc/init.d/dhcp-relay not yet configured! - Aborting..." -exit 1; - - - -# Build command line for interfaces (will be passed to dhrelay below.) -IFCMD="" -if test "$INTERFACES" != ""; then - for I in $INTERFACES; do - IFCMD=${IFCMD}"-i "${I}" " - done -fi - -DHCRELAYPID=/var/run/dhcrelay.pid - -case "$1" in - start) - start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS - ;; - stop) - start-stop-daemon -K -x /usr/sbin/dhcrelay - ;; - restart | force-reload) - $0 stop - sleep 2 - $0 start - ;; - *) - echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}" - exit 1 -esac - -exit 0 diff --git a/package/dhcp/init-server b/package/dhcp/init-server deleted file mode 100755 index 7c7f893a14..0000000000 --- a/package/dhcp/init-server +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $ -# - - - -# On what interfaces should the DHCP server (dhcpd) serve DHCP requests? -# Separate multiple interfaces with spaces, e.g. "eth0 eth1". -INTERFACES="" - - -# It is not safe to start if we don't have a default configuration... -echo "/etc/init.d/dhcp-server not yet configured! - Aborting..." -exit 1; - - - -test -f /usr/sbin/dhcpd || exit 0 - - -case "$1" in - start) - echo -n "Starting DHCP server: " - test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/ - test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases - start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES - echo "." - ;; - stop) - echo -n "Stopping DHCP server: dhcpd3" - start-stop-daemon -K -x /usr/sbin/dhcpd - echo "." - ;; - restart | force-reload) - $0 stop - sleep 2 - $0 start - if [ "$?" != "0" ]; then - exit 1 - fi - ;; - *) - echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}" - exit 1 -esac - -exit 0 diff --git a/package/hal/S98haldaemon b/package/hal/S98haldaemon new file mode 100755 index 0000000000..40ea0f4d34 --- /dev/null +++ b/package/hal/S98haldaemon @@ -0,0 +1,56 @@ +#!/bin/sh +# +# haldaemon: HAL daemon +# +# chkconfig: 345 98 02 +# description: This is a daemon for collecting and maintaing information \ +# about hardware from several sources. \ +# See http://www.freedesktop.org/Software/hal +# +# processname: hald +# pidfile: /var/run/haldaemon.pid +# + +# Sanity checks. +[ -x /usr/sbin/hald ] || exit 0 + +RETVAL=0 + +start() { + echo -n "Starting HAL daemon: " + hald + RETVAL=$? + echo "done" + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/haldaemon +} + +stop() { + echo -n "Stopping HAL daemon: " + + killall hald + RETVAL=$? + echo "done" + if [ $RETVAL -eq 0 ]; then + rm -f /var/lock/subsys/haldaemon + rm -f /var/run/haldaemon.pid + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + sleep 3 + start + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + ;; +esac +exit $RETVAL diff --git a/package/hal/hal.mk b/package/hal/hal.mk index 3d35a4c675..130d0da465 100644 --- a/package/hal/hal.mk +++ b/package/hal/hal.mk @@ -74,7 +74,7 @@ $(TARGET_DIR)/$(HAL_TARGET_BINARY): $(HAL_DIR)/hald/hald rm -rf $(TARGET_DIR)/usr/lib/libhal*.la rm -rf $(TARGET_DIR)/usr/lib/hal rm -rf $(TARGET_DIR)/etc/PolicyKit - $(INSTALL) -m 0755 -D package/hal/init-hal $(TARGET_DIR)/etc/init.d/S98haldaemon + $(INSTALL) -m 0755 -D package/hal/S98haldaemon $(TARGET_DIR)/etc/init.d rm -rf $(TARGET_DIR)/etc/rc.d for file in hald-addon-acpi* hald-addon-cpufreq \ hald-addon-keyboard hald-addon-pmu \ diff --git a/package/hal/init-hal b/package/hal/init-hal deleted file mode 100755 index 40ea0f4d34..0000000000 --- a/package/hal/init-hal +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# -# haldaemon: HAL daemon -# -# chkconfig: 345 98 02 -# description: This is a daemon for collecting and maintaing information \ -# about hardware from several sources. \ -# See http://www.freedesktop.org/Software/hal -# -# processname: hald -# pidfile: /var/run/haldaemon.pid -# - -# Sanity checks. -[ -x /usr/sbin/hald ] || exit 0 - -RETVAL=0 - -start() { - echo -n "Starting HAL daemon: " - hald - RETVAL=$? - echo "done" - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/haldaemon -} - -stop() { - echo -n "Stopping HAL daemon: " - - killall hald - RETVAL=$? - echo "done" - if [ $RETVAL -eq 0 ]; then - rm -f /var/lock/subsys/haldaemon - rm -f /var/run/haldaemon.pid - fi -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - sleep 3 - start - ;; - *) - echo $"Usage: $0 {start|stop|restart}" - ;; -esac -exit $RETVAL diff --git a/package/ltt/S27tracer b/package/ltt/S27tracer new file mode 100755 index 0000000000..3dee49211b --- /dev/null +++ b/package/ltt/S27tracer @@ -0,0 +1,93 @@ +#!/bin/sh +# +# Load tracer module and create tracer device node. +# + +MODULE="tracer" +MAIN_DEVICE="tracer" +USER_DEVICE="tracerU" +GROUP="root" +MODE="664" + +start() { + if [ -e /dev/${MAIN_DEVICE} -o -e /dev/${USER_DEVICE} ] + then + # tell the user about what we are doing + echo "Deleting old tracer nodes: /dev/tracer and /dev/tracerU" + + # remove stale nodes + rm -f /dev/${MAIN_DEVICE} + rm -f /dev/${USER_DEVICE} + fi + + # look for the major number + MAJOR=`/bin/grep " ${MODULE}$" /proc/devices | cut -d" " -f1` + + # does the device exist? + if [ ${MAJOR} ] + then + echo "Found tracer device with major number:" ${MAJOR} + else + echo "Loading tracer kernel module: " + # invoke modprobe + /sbin/modprobe ${MODULE} + MAJOR=`/bin/grep " ${MODULE}$" /proc/devices | cut -d" " -f1` + if [ ${MAJOR} ] + then + echo "Found tracer device with major number:" ${MAJOR} + else + echo "Did not find tracer device ... /dev entries not created ..." + exit 1 + fi + fi + + # tell the user about what we are doing + echo "Creating new tracer nodes: /dev/tracer and /dev/tracerU" + + # create the character special file + /bin/mknod /dev/${MAIN_DEVICE} c ${MAJOR} 0 + /bin/mknod /dev/${USER_DEVICE} c ${MAJOR} 1 + + # set permissions and ownership + /bin/chgrp ${GROUP} /dev/${MAIN_DEVICE} + /bin/chmod ${MODE} /dev/${MAIN_DEVICE} + /bin/chgrp ${GROUP} /dev/${USER_DEVICE} + /bin/chmod ${MODE} /dev/${USER_DEVICE} +} +stop() { + # tell the user about what we are doing + echo "Deleting tracer nodes: /dev/tracer and /dev/tracerU" + + # remove nodes + rm -f /dev/${MAIN_DEVICE} + rm -f /dev/${USER_DEVICE} + + if lsmod | /bin/grep "^${MODULE} " + then + echo -n "Removing tracer kernel module: " + # invoke modprobe -r + /sbin/modprobe -r ${MODULE} + echo "OK" + fi +} +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/package/ltt/init-tracer b/package/ltt/init-tracer deleted file mode 100755 index 3dee49211b..0000000000 --- a/package/ltt/init-tracer +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# -# Load tracer module and create tracer device node. -# - -MODULE="tracer" -MAIN_DEVICE="tracer" -USER_DEVICE="tracerU" -GROUP="root" -MODE="664" - -start() { - if [ -e /dev/${MAIN_DEVICE} -o -e /dev/${USER_DEVICE} ] - then - # tell the user about what we are doing - echo "Deleting old tracer nodes: /dev/tracer and /dev/tracerU" - - # remove stale nodes - rm -f /dev/${MAIN_DEVICE} - rm -f /dev/${USER_DEVICE} - fi - - # look for the major number - MAJOR=`/bin/grep " ${MODULE}$" /proc/devices | cut -d" " -f1` - - # does the device exist? - if [ ${MAJOR} ] - then - echo "Found tracer device with major number:" ${MAJOR} - else - echo "Loading tracer kernel module: " - # invoke modprobe - /sbin/modprobe ${MODULE} - MAJOR=`/bin/grep " ${MODULE}$" /proc/devices | cut -d" " -f1` - if [ ${MAJOR} ] - then - echo "Found tracer device with major number:" ${MAJOR} - else - echo "Did not find tracer device ... /dev entries not created ..." - exit 1 - fi - fi - - # tell the user about what we are doing - echo "Creating new tracer nodes: /dev/tracer and /dev/tracerU" - - # create the character special file - /bin/mknod /dev/${MAIN_DEVICE} c ${MAJOR} 0 - /bin/mknod /dev/${USER_DEVICE} c ${MAJOR} 1 - - # set permissions and ownership - /bin/chgrp ${GROUP} /dev/${MAIN_DEVICE} - /bin/chmod ${MODE} /dev/${MAIN_DEVICE} - /bin/chgrp ${GROUP} /dev/${USER_DEVICE} - /bin/chmod ${MODE} /dev/${USER_DEVICE} -} -stop() { - # tell the user about what we are doing - echo "Deleting tracer nodes: /dev/tracer and /dev/tracerU" - - # remove nodes - rm -f /dev/${MAIN_DEVICE} - rm -f /dev/${USER_DEVICE} - - if lsmod | /bin/grep "^${MODULE} " - then - echo -n "Removing tracer kernel module: " - # invoke modprobe -r - /sbin/modprobe -r ${MODULE} - echo "OK" - fi -} -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - restart - ;; - *) - echo $"Usage: $0 {start|stop|restart}" - exit 1 -esac - -exit $? diff --git a/package/ltt/ltt.mk b/package/ltt/ltt.mk index f4a2d0962f..3626c232d1 100644 --- a/package/ltt/ltt.mk +++ b/package/ltt/ltt.mk @@ -98,7 +98,7 @@ $(TARGET_DIR)/usr/bin/tracedaemon: $(LTT_DIR2)/$(LTT_TARGET_BINARY) $(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) \ -C $(LTT_DIR2)/Daemon install $(STRIP) $(TARGET_DIR)/usr/bin/tracedaemon > /dev/null 2>&1 - $(INSTALL) -D -m 0755 package/ltt/init-tracer $(TARGET_DIR)/etc/init.d/S27tracer + $(INSTALL) -D -m 0755 package/ltt/S27tracer $(TARGET_DIR)/etc/init.d ltt-tracedaemon: uclibc $(TARGET_DIR)/usr/bin/tracedaemon diff --git a/package/netplug/S29netplug b/package/netplug/S29netplug new file mode 100755 index 0000000000..791e14b889 --- /dev/null +++ b/package/netplug/S29netplug @@ -0,0 +1,69 @@ +#!/bin/sh +# +# netplugd This shell script takes care of starting and stopping +# the network plug management daemon. +# +# chkconfig: - 11 89 +# description: netplugd is a daemon for managing non-static network \ +# interfaces. +# processname: netplugd +# pidfile: /var/run/netplugd.pid + +# Copyright 2003 Key Research, Inc. + +# Source function library. +if [ -f /etc/init.d/functions ]; then + . /etc/init.d/functions +elif [ -f /etc/rc.d/init.d/functions ]; then + . /etc/rc.d/init.d/functions +fi + +# Source networking configuration. +if [ -f /etc/sysconfig/network ]; then + . /etc/sysconfig/network + + # Check that networking is up. + [ ${NETWORKING} = "no" ] && exit 0 +elif [ ! -f /etc/network/interfaces ]; then + # No network support + exit 0 +fi + +[ -x /sbin/netplugd ] || exit 0 + +if [ -f /etc/sysconfig/netplugd ]; then + . /etc/sysconfig/netplugd +fi + +# See how we were called. +case "$1" in + start) + # Start daemon. + echo -n $"Starting network plug daemon: " + start-stop-daemon --start --quiet --pidfile /var/run/netplugd.pid --exec /sbin/netplugd ${NETPLUGDARGS} + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/netplugd + ;; + stop) + # Stop daemon. + echo -n $"Shutting down network plug daemon: " + start-stop-daemon --stop --name netplugd + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netplugd + ;; + restart|reload) + $0 stop + $0 start + ;; + condrestart) + [ -f /var/lock/subsys/netplugd ] && $0 restart || : + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + RETVAL=1 + ;; +esac + +exit $RETVAL diff --git a/package/netplug/init-netplug b/package/netplug/init-netplug deleted file mode 100755 index 791e14b889..0000000000 --- a/package/netplug/init-netplug +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# -# netplugd This shell script takes care of starting and stopping -# the network plug management daemon. -# -# chkconfig: - 11 89 -# description: netplugd is a daemon for managing non-static network \ -# interfaces. -# processname: netplugd -# pidfile: /var/run/netplugd.pid - -# Copyright 2003 Key Research, Inc. - -# Source function library. -if [ -f /etc/init.d/functions ]; then - . /etc/init.d/functions -elif [ -f /etc/rc.d/init.d/functions ]; then - . /etc/rc.d/init.d/functions -fi - -# Source networking configuration. -if [ -f /etc/sysconfig/network ]; then - . /etc/sysconfig/network - - # Check that networking is up. - [ ${NETWORKING} = "no" ] && exit 0 -elif [ ! -f /etc/network/interfaces ]; then - # No network support - exit 0 -fi - -[ -x /sbin/netplugd ] || exit 0 - -if [ -f /etc/sysconfig/netplugd ]; then - . /etc/sysconfig/netplugd -fi - -# See how we were called. -case "$1" in - start) - # Start daemon. - echo -n $"Starting network plug daemon: " - start-stop-daemon --start --quiet --pidfile /var/run/netplugd.pid --exec /sbin/netplugd ${NETPLUGDARGS} - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/netplugd - ;; - stop) - # Stop daemon. - echo -n $"Shutting down network plug daemon: " - start-stop-daemon --stop --name netplugd - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netplugd - ;; - restart|reload) - $0 stop - $0 start - ;; - condrestart) - [ -f /var/lock/subsys/netplugd ] && $0 restart || : - ;; - *) - echo $"Usage: $0 {start|stop|restart}" - RETVAL=1 - ;; -esac - -exit $RETVAL diff --git a/package/netplug/netplug.mk b/package/netplug/netplug.mk index 018b03b636..bf9b92cf3f 100644 --- a/package/netplug/netplug.mk +++ b/package/netplug/netplug.mk @@ -28,7 +28,7 @@ $(NETPLUG_DIR)/$(NETPLUG_BINARY): $(NETPLUG_DIR)/.unpacked $(TARGET_DIR)/$(NETPLUG_TARGET_BINARY): $(NETPLUG_DIR)/$(NETPLUG_BINARY) $(INSTALL) -m 644 -D $(NETPLUG_DIR)/etc/netplugd.conf $(TARGET_DIR)/etc/netplug/netplugd.conf $(INSTALL) -m 755 -D package/netplug/netplug-script $(TARGET_DIR)/etc/netplug.d/netplug - $(INSTALL) -m 755 -D package/netplug/init-netplug $(TARGET_DIR)/etc/init.d/S29netplug + $(INSTALL) -m 755 -D package/netplug/S29netplug $(TARGET_DIR)/etc/init.d $(INSTALL) -m 755 -D $(NETPLUG_DIR)/$(NETPLUG_BINARY) $(TARGET_DIR)/$(NETPLUG_TARGET_BINARY) touch -c $(TARGET_DIR)/$(NETPLUG_TARGET_BINARY) diff --git a/package/nfs-utils/S60nfs b/package/nfs-utils/S60nfs new file mode 100755 index 0000000000..49dab70151 --- /dev/null +++ b/package/nfs-utils/S60nfs @@ -0,0 +1,89 @@ +#!/bin/sh +# +# nfs This shell script takes care of starting and stopping +# the NFS services. Stolen from RedHat FC5. + +[ -x /usr/sbin/rpc.statd ] || exit 0 +[ -x /usr/sbin/rpc.nfsd ] || exit 0 +[ -x /usr/sbin/rpc.mountd ] || exit 0 +[ -x /usr/sbin/exportfs ] || exit 0 + +# Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue. +[ -r /etc/exports ] || \ + { touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \ + { echo "/etc/exports does not exist" ; exit 0 ; } + +# The /var/lib/nfs directory is actually on a tmpfs filesystem. +mkdir -p /var/lib/nfs/sm +mkdir -p /var/lib/nfs/sm.bak +touch /var/lib/nfs/etab +touch /var/lib/nfs/rmtab +touch /var/lib/nfs/state +touch /var/lib/nfs/xtab + +start() { + # Start daemons. + echo -n "Starting NFS statd: " + rpc.statd + touch /var/lock/subsys/nfslock + echo "done" + + echo -n "Starting NFS services: " + /usr/sbin/exportfs -r + rpc.statd + echo "done" + + echo -n "Starting NFS daemon: " + rpc.nfsd 2 + echo "done" + + echo -n "Starting NFS mountd: " + rpc.mountd + echo "done" + touch /var/lock/subsys/nfs +} + +stop() { + # Stop daemons. + echo -n "Shutting down NFS mountd: " + killall -q rpc.mountd + echo "done" + + echo "Shutting down NFS daemon: " + kill -9 `pidof nfsd` 2>/dev/null + echo "done" + + echo -n "Shutting down NFS services: " + /usr/sbin/exportfs -au + rm -f /var/lock/subsys/nfs + killall -q rpc.statd + echo "done" + + echo -n "Stopping NFS statd: " + killall -q rpc.statd + echo "done" + rm -f /var/lock/subsys/nfslock +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + reload) + /usr/sbin/exportfs -r + touch /var/lock/subsys/nfs + ;; + *) + echo "Usage: nfs {start|stop|reload}" + exit 1 +esac + +exit 0 diff --git a/package/nfs-utils/init-nfs b/package/nfs-utils/init-nfs deleted file mode 100755 index 49dab70151..0000000000 --- a/package/nfs-utils/init-nfs +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -# -# nfs This shell script takes care of starting and stopping -# the NFS services. Stolen from RedHat FC5. - -[ -x /usr/sbin/rpc.statd ] || exit 0 -[ -x /usr/sbin/rpc.nfsd ] || exit 0 -[ -x /usr/sbin/rpc.mountd ] || exit 0 -[ -x /usr/sbin/exportfs ] || exit 0 - -# Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue. -[ -r /etc/exports ] || \ - { touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \ - { echo "/etc/exports does not exist" ; exit 0 ; } - -# The /var/lib/nfs directory is actually on a tmpfs filesystem. -mkdir -p /var/lib/nfs/sm -mkdir -p /var/lib/nfs/sm.bak -touch /var/lib/nfs/etab -touch /var/lib/nfs/rmtab -touch /var/lib/nfs/state -touch /var/lib/nfs/xtab - -start() { - # Start daemons. - echo -n "Starting NFS statd: " - rpc.statd - touch /var/lock/subsys/nfslock - echo "done" - - echo -n "Starting NFS services: " - /usr/sbin/exportfs -r - rpc.statd - echo "done" - - echo -n "Starting NFS daemon: " - rpc.nfsd 2 - echo "done" - - echo -n "Starting NFS mountd: " - rpc.mountd - echo "done" - touch /var/lock/subsys/nfs -} - -stop() { - # Stop daemons. - echo -n "Shutting down NFS mountd: " - killall -q rpc.mountd - echo "done" - - echo "Shutting down NFS daemon: " - kill -9 `pidof nfsd` 2>/dev/null - echo "done" - - echo -n "Shutting down NFS services: " - /usr/sbin/exportfs -au - rm -f /var/lock/subsys/nfs - killall -q rpc.statd - echo "done" - - echo -n "Stopping NFS statd: " - killall -q rpc.statd - echo "done" - rm -f /var/lock/subsys/nfslock -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - reload) - /usr/sbin/exportfs -r - touch /var/lock/subsys/nfs - ;; - *) - echo "Usage: nfs {start|stop|reload}" - exit 1 -esac - -exit 0 diff --git a/package/nfs-utils/nfs-utils.mk b/package/nfs-utils/nfs-utils.mk index 36cc523470..b79a9e3d5f 100644 --- a/package/nfs-utils/nfs-utils.mk +++ b/package/nfs-utils/nfs-utils.mk @@ -64,7 +64,7 @@ $(STAGING_DIR)/.fakeroot.nfs-utils: $(NFS_UTILS_DIR)/$(NFS_UTILS_BINARY) echo "$(MAKE) prefix=$(TARGET_DIR)/usr statedir=$(TARGET_DIR)/var/lib/nfs CC=$(TARGET_CC) -C $(NFS_UTILS_DIR) install" > $@ echo "rm -f $(TARGET_DIR)/usr/bin/event_rpcgen.py $(TARGET_DIR)/usr/sbin/nhfs* $(TARGET_DIR)/usr/sbin/nfsstat $(TARGET_DIR)/usr/sbin/showmount" >> $@ echo "rm -rf $(TARGET_DIR)/usr/share/man" >> $@ - echo "$(INSTALL) -m 0755 -D package/nfs-utils/init-nfs $(TARGET_DIR)/etc/init.d/S60nfs" >> $@ + echo "$(INSTALL) -m 0755 -D package/nfs-utils/S60nfs $(TARGET_DIR)/etc/init.d" >> $@ echo -n "for file in $(NFS_UTILS_TARGETS_) ; do rm -f $(TARGET_DIR)/" >> $@ echo -n "\$$" >> $@ echo "file; done" >> $@ diff --git a/package/portmap/S13portmap b/package/portmap/S13portmap new file mode 100755 index 0000000000..573a16abf0 --- /dev/null +++ b/package/portmap/S13portmap @@ -0,0 +1,44 @@ +#! /bin/sh + +[ -f /sbin/portmap ] || exit 0 + +start() { + echo -n "Starting portmap: " + portmap + mkdir -p /var/lock/subsys + touch /var/lock/subsys/portmap + echo "done" +} + + +stop() { + echo -n "Stopping portmap: " + echo + killall portmap + rm -rf /var/lock/subsys + echo "done" +} + +restart() { + stop + start + rm -f /var/run/portmap.state +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo "Usage: $0 {start|stop|reload|restart}" + exit 1 +esac + +exit $? diff --git a/package/portmap/init-portmap b/package/portmap/init-portmap deleted file mode 100755 index 573a16abf0..0000000000 --- a/package/portmap/init-portmap +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/sh - -[ -f /sbin/portmap ] || exit 0 - -start() { - echo -n "Starting portmap: " - portmap - mkdir -p /var/lock/subsys - touch /var/lock/subsys/portmap - echo "done" -} - - -stop() { - echo -n "Stopping portmap: " - echo - killall portmap - rm -rf /var/lock/subsys - echo "done" -} - -restart() { - stop - start - rm -f /var/run/portmap.state -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - restart - ;; - *) - echo "Usage: $0 {start|stop|reload|restart}" - exit 1 -esac - -exit $? diff --git a/package/portmap/portmap.mk b/package/portmap/portmap.mk index 29fdc2927c..6b0ba453a0 100644 --- a/package/portmap/portmap.mk +++ b/package/portmap/portmap.mk @@ -26,7 +26,7 @@ $(PORTMAP_DIR)/$(PORTMAP_BINARY): $(PORTMAP_DIR)/.unpacked $(TARGET_DIR)/$(PORTMAP_TARGET_BINARY): $(PORTMAP_DIR)/$(PORTMAP_BINARY) $(INSTALL) -D $(PORTMAP_DIR)/$(PORTMAP_BINARY) $(TARGET_DIR)/$(PORTMAP_TARGET_BINARY) - $(INSTALL) -m 0755 -D package/portmap/init-portmap $(TARGET_DIR)/etc/init.d/S13portmap + $(INSTALL) -m 0755 -D package/portmap/S13portmap $(TARGET_DIR)/etc/init.d portmap: uclibc $(TARGET_DIR)/$(PORTMAP_TARGET_BINARY) diff --git a/package/proftpd/S50proftpd b/package/proftpd/S50proftpd new file mode 100755 index 0000000000..550e0a6ad0 --- /dev/null +++ b/package/proftpd/S50proftpd @@ -0,0 +1,47 @@ +#!/bin/sh + +DAEMON=/usr/sbin/proftpd +trap "" 1 +trap "" 15 +test -f $DAEMON || exit 0 +[ ! -d /var/run/proftpd ] && mkdir /var/run/proftpd +[ ! -f /var/log/wtmp ] && touch /var/log/wtmp + +start() { + echo -n "Starting ProFTPD: " + $DAEMON + if [ $? != 0 ]; then + echo "FAILED" + exit 1 + else + echo "done" + fi +} + +stop() { + echo -n "Stopping ProFTPD: " + killall proftpd + echo "done" +} + +case "$1" in + start) + start + ;; + + stop) + stop + ;; + + restart) + stop + start + ;; + + *) + echo "Usage: /etc/init.d/S50proftpd {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/package/proftpd/init-proftpd b/package/proftpd/init-proftpd deleted file mode 100755 index 550e0a6ad0..0000000000 --- a/package/proftpd/init-proftpd +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -DAEMON=/usr/sbin/proftpd -trap "" 1 -trap "" 15 -test -f $DAEMON || exit 0 -[ ! -d /var/run/proftpd ] && mkdir /var/run/proftpd -[ ! -f /var/log/wtmp ] && touch /var/log/wtmp - -start() { - echo -n "Starting ProFTPD: " - $DAEMON - if [ $? != 0 ]; then - echo "FAILED" - exit 1 - else - echo "done" - fi -} - -stop() { - echo -n "Stopping ProFTPD: " - killall proftpd - echo "done" -} - -case "$1" in - start) - start - ;; - - stop) - stop - ;; - - restart) - stop - start - ;; - - *) - echo "Usage: /etc/init.d/S50proftpd {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 diff --git a/package/proftpd/proftpd.mk b/package/proftpd/proftpd.mk index d2e7fada7d..231f4535a2 100644 --- a/package/proftpd/proftpd.mk +++ b/package/proftpd/proftpd.mk @@ -56,7 +56,7 @@ $(TARGET_DIR)/$(PROFTPD_TARGET_BINARY): $(PROFTPD_DIR)/$(PROFTPD_BINARY) @if [ ! -f $(TARGET_DIR)/etc/proftpd.conf ] ; then \ $(INSTALL) -m 0644 -D $(PROFTPD_DIR)/sample-configurations/basic.conf $(TARGET_DIR)/etc/proftpd.conf; \ fi; - $(INSTALL) -m 0755 -D package/proftpd/init-proftpd $(TARGET_DIR)/etc/init.d/S50proftpd + $(INSTALL) -m 0755 -D package/proftpd/S50proftpd $(TARGET_DIR)/etc/init.d proftpd: uclibc $(TARGET_DIR)/$(PROFTPD_TARGET_BINARY) diff --git a/package/samba/S91smb b/package/samba/S91smb new file mode 100755 index 0000000000..859b540084 --- /dev/null +++ b/package/samba/S91smb @@ -0,0 +1,79 @@ +#!/bin/sh +# +# Stolen from RedHat FC5. +# + +# Check that smb.conf exists. +[ -f /etc/samba/smb.conf ] || exit 0 + +# Make directories. +mkdir -p /var/cache/samba +mkdir -p /var/log/samba + +RETVAL=0 + +start() { + echo -n "Starting SMB services: " + smbd -D + RETVAL=$? + echo "done" + + echo -n "Starting NMB services: " + nmbd -D + RETVAL2=$? + echo "done" + + [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \ + RETVAL=1 + return $RETVAL +} + +stop() { + echo -n "Shutting down SMB services: " + kill -9 `pidof smbd` + RETVAL=$? + rm -f /var/run/smbd.pid + echo "done" + + echo -n "Shutting down NMB services: " + kill -9 `pidof nmbd` + RETVAL2=$? + rm -f /var/run/nmbd.pid + + [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb + echo "done" + return $RETVAL +} + +restart() { + stop + start +} + +reload() { + echo -n "Reloading smb.conf file: " + kill -HUP `pidof smbd` + RETVAL=$? + echo "done" + return $RETVAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac + +exit $? diff --git a/package/samba/init-samba b/package/samba/init-samba deleted file mode 100755 index 859b540084..0000000000 --- a/package/samba/init-samba +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh -# -# Stolen from RedHat FC5. -# - -# Check that smb.conf exists. -[ -f /etc/samba/smb.conf ] || exit 0 - -# Make directories. -mkdir -p /var/cache/samba -mkdir -p /var/log/samba - -RETVAL=0 - -start() { - echo -n "Starting SMB services: " - smbd -D - RETVAL=$? - echo "done" - - echo -n "Starting NMB services: " - nmbd -D - RETVAL2=$? - echo "done" - - [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \ - RETVAL=1 - return $RETVAL -} - -stop() { - echo -n "Shutting down SMB services: " - kill -9 `pidof smbd` - RETVAL=$? - rm -f /var/run/smbd.pid - echo "done" - - echo -n "Shutting down NMB services: " - kill -9 `pidof nmbd` - RETVAL2=$? - rm -f /var/run/nmbd.pid - - [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb - echo "done" - return $RETVAL -} - -restart() { - stop - start -} - -reload() { - echo -n "Reloading smb.conf file: " - kill -HUP `pidof smbd` - RETVAL=$? - echo "done" - return $RETVAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - reload) - reload - ;; - *) - echo "Usage: $0 {start|stop|restart|reload}" - exit 1 -esac - -exit $? diff --git a/package/samba/samba.mk b/package/samba/samba.mk index af8bfcd89e..dd177c063b 100644 --- a/package/samba/samba.mk +++ b/package/samba/samba.mk @@ -92,7 +92,7 @@ $(TARGET_DIR)/$(SAMBA_TARGET_BINARY): $(SAMBA_DIR)/$(SAMBA_BINARY) for file in $(SAMBA_TARGETS_) ; do \ rm -f $(TARGET_DIR)/$$file; \ done - $(INSTALL) -m 0755 -D package/samba/init-samba $(TARGET_DIR)/etc/init.d/S91smb + $(INSTALL) -m 0755 -D package/samba/S91smb $(TARGET_DIR)/etc/init.d @if [ ! -f $(TARGET_DIR)/etc/samba/smb.conf ] ; then \ $(INSTALL) -m 0755 -D package/samba/simple.conf $(TARGET_DIR)/etc/samba/smb.conf; \ fi; diff --git a/package/sysklogd/S25syslog b/package/sysklogd/S25syslog new file mode 100755 index 0000000000..07683ed2f0 --- /dev/null +++ b/package/sysklogd/S25syslog @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Starts syslog. +# + + + +umask 077 + +start() { + echo -n "Starting syslogd: " + start-stop-daemon --start --quiet --pidfile /var/run/syslog.pid --exec /sbin/syslogd -- -m 0 + echo "OK" + + echo -n "Starting klogd: " + start-stop-daemon --start --quiet --pidfile /var/run/klogd.pid --exec /sbin/klogd + echo "OK" +} +stop() { + echo -n "Stopping klogd: " + start-stop-daemon --stop --name klogd + echo "OK" + + echo -n "Stopping syslogd: " + start-stop-daemon --stop --name syslogd + echo "OK" +} +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/package/sysklogd/init-syslog b/package/sysklogd/init-syslog deleted file mode 100755 index 07683ed2f0..0000000000 --- a/package/sysklogd/init-syslog +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# Starts syslog. -# - - - -umask 077 - -start() { - echo -n "Starting syslogd: " - start-stop-daemon --start --quiet --pidfile /var/run/syslog.pid --exec /sbin/syslogd -- -m 0 - echo "OK" - - echo -n "Starting klogd: " - start-stop-daemon --start --quiet --pidfile /var/run/klogd.pid --exec /sbin/klogd - echo "OK" -} -stop() { - echo -n "Stopping klogd: " - start-stop-daemon --stop --name klogd - echo "OK" - - echo -n "Stopping syslogd: " - start-stop-daemon --stop --name syslogd - echo "OK" -} -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - restart - ;; - *) - echo $"Usage: $0 {start|stop|restart}" - exit 1 -esac - -exit $? diff --git a/package/sysklogd/sysklogd.mk b/package/sysklogd/sysklogd.mk index 84f966c655..1836fa0d4e 100644 --- a/package/sysklogd/sysklogd.mk +++ b/package/sysklogd/sysklogd.mk @@ -32,7 +32,7 @@ $(SYSKLOGD_DIR)/$(SYSKLOGD_BINARY): $(SYSKLOGD_DIR)/.unpacked $(TARGET_DIR)/$(SYSKLOGD_TARGET_BINARY): $(SYSKLOGD_DIR)/$(SYSKLOGD_BINARY) $(INSTALL) -m 0755 -D $(SYSKLOGD_DIR)/$(SYSKLOGD_SYSLOGD_BINARY) $(TARGET_DIR)/$(SYSKLOGD_SYSLOGD_TARGET_BINARY) $(INSTALL) -m 0755 -D $(SYSKLOGD_DIR)/$(SYSKLOGD_KLOGD_BINARY) $(TARGET_DIR)/$(SYSKLOGD_KLOGD_TARGET_BINARY) - $(INSTALL) -m 0755 -D package/sysklogd/init-syslog $(TARGET_DIR)/etc/init.d/S25syslog + $(INSTALL) -m 0755 -D package/sysklogd/S25syslog $(TARGET_DIR)/etc/init.d $(INSTALL) -m 0644 -D package/sysklogd/syslog.conf $(TARGET_DIR)/etc/syslog.conf sysklogd: uclibc $(TARGET_DIR)/$(SYSKLOGD_TARGET_BINARY) diff --git a/package/tftpd/S80tftpd-hpa b/package/tftpd/S80tftpd-hpa new file mode 100755 index 0000000000..41c28d148d --- /dev/null +++ b/package/tftpd/S80tftpd-hpa @@ -0,0 +1,81 @@ +#! /bin/sh + +OPTIONS="-c -l -s /var/lib/tftpboot" + +set -e + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DESC="HPA's tftpd" +NAME=in.tftpd +DAEMON=/usr/sbin/$NAME +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/S80tftpd-hpa + +# +# Function that starts the daemon/service. +# +d_start() { + mkdir -p /var/lib/tftpboot + chmod 1777 /var/lib/tftpboot + $DAEMON $OPTIONS +} + +# +# Function that stops the daemon/service. +# +d_stop() { + killall -q $NAME +} + +# +# Function that sends a SIGHUP to the daemon/service. +# +d_reload() { + d_start + d_stop +} + +case "$1" in + start) + echo -n "Starting $DESC: " + d_start + echo "done" + ;; + stop) + echo -n "Stopping $DESC: " + d_stop + echo "done" + ;; + #reload) + # + # If the daemon can reload its configuration without + # restarting (for example, when it is sent a SIGHUP), + # then implement that here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this an "exit 0". + # + # echo -n "Reloading $DESC configuration..." + # d_reload + # echo "done." + #;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + echo -n "Restarting $DESC: " + d_stop + sleep 1 + d_start + echo "done" + ;; + *) + # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/package/tftpd/init-tftpd b/package/tftpd/init-tftpd deleted file mode 100755 index 41c28d148d..0000000000 --- a/package/tftpd/init-tftpd +++ /dev/null @@ -1,81 +0,0 @@ -#! /bin/sh - -OPTIONS="-c -l -s /var/lib/tftpboot" - -set -e - -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DESC="HPA's tftpd" -NAME=in.tftpd -DAEMON=/usr/sbin/$NAME -PIDFILE=/var/run/$NAME.pid -SCRIPTNAME=/etc/init.d/S80tftpd-hpa - -# -# Function that starts the daemon/service. -# -d_start() { - mkdir -p /var/lib/tftpboot - chmod 1777 /var/lib/tftpboot - $DAEMON $OPTIONS -} - -# -# Function that stops the daemon/service. -# -d_stop() { - killall -q $NAME -} - -# -# Function that sends a SIGHUP to the daemon/service. -# -d_reload() { - d_start - d_stop -} - -case "$1" in - start) - echo -n "Starting $DESC: " - d_start - echo "done" - ;; - stop) - echo -n "Stopping $DESC: " - d_stop - echo "done" - ;; - #reload) - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - # If the daemon responds to changes in its config file - # directly anyway, make this an "exit 0". - # - # echo -n "Reloading $DESC configuration..." - # d_reload - # echo "done." - #;; - restart|force-reload) - # - # If the "reload" option is implemented, move the "force-reload" - # option to the "reload" entry above. If not, "force-reload" is - # just the same as "restart". - # - echo -n "Restarting $DESC: " - d_stop - sleep 1 - d_start - echo "done" - ;; - *) - # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/package/tftpd/tftpd.mk b/package/tftpd/tftpd.mk index 69d15d910a..8a9b6c5900 100644 --- a/package/tftpd/tftpd.mk +++ b/package/tftpd/tftpd.mk @@ -59,7 +59,7 @@ $(TARGET_DIR)/$(TFTP_HPA_TARGET_BINARY): $(TFTP_HPA_DIR)/$(TFTP_HPA_BINARY) rm -f $(TARGET_DIR)/$(TFTP_HPA_TARGET_BINARY); \ cp -a $(TFTP_HPA_DIR)/$(TFTP_HPA_BINARY) $(TARGET_DIR)/$(TFTP_HPA_TARGET_BINARY); fi ; @if [ ! -f $(TARGET_DIR)/etc/init.d/S80tftpd-hpa ] ; then \ - $(INSTALL) -m 0755 -D package/tftpd/init-tftpd $(TARGET_DIR)/etc/init.d/S80tftpd-hpa; \ + $(INSTALL) -m 0755 -D package/tftpd/S80tftpd-hpa $(TARGET_DIR)/etc/init.d \ fi; tftpd: uclibc $(TARGET_DIR)/$(TFTP_HPA_TARGET_BINARY) diff --git a/package/udev/S10udev b/package/udev/S10udev new file mode 100755 index 0000000000..220fbcef6e --- /dev/null +++ b/package/udev/S10udev @@ -0,0 +1,81 @@ +#!/bin/sh +# +# udev This is a minimal non-LSB version of a UDEV startup script. It +# was derived by stripping down the udev-058 LSB version for use +# with buildroot on embedded hardware using Linux 2.6.12+ kernels. +# +# You may need to customize this for your system's resource limits +# (including startup time!) and administration. For example, if +# your early userspace has a custom initramfs or initrd you might +# need /dev much earlier; or without hotpluggable busses (like USB, +# PCMCIA, MMC/SD, and so on) your /dev might be static after boot. +# +# This script assumes your system boots right into the eventual root +# filesystem, and that init runs this udev script before any programs +# needing more device nodes than the bare-bones set -- /dev/console, +# /dev/zero, /dev/null -- that's needed to boot and run this script. +# + +# old kernels don't use udev +case $(uname -r) in + 2.6*|2.7*) ;; + *) exit 0;; +esac + +# Check for missing binaries +UDEV_BIN=/sbin/udevd +test -x $UDEV_BIN || exit 5 +UDEVSTART_BIN=/sbin/udevstart +test -x $UDEVSTART_BIN || exit 5 + +# Check for config file and read it +UDEV_CONFIG=/etc/udev/udev.conf +test -r $UDEV_CONFIG || exit 6 +. $UDEV_CONFIG + +# Directory where sysfs is mounted +SYSFS_DIR=/sys + +case "$1" in + start) + # mount sysfs if it's not yet mounted + if [ ! -d $SYSFS_DIR ]; then + echo "${0}: SYSFS_DIR \"$SYSFS_DIR\" not found" + exit 1 + fi + grep -q "^sysfs $SYSFS_DIR" /proc/mounts || + mount -t sysfs /sys /sys || + exit 1 + + # mount $udev_root as ramfs if it's not yet mounted + # we know 2.6 kernels always support ramfs + if [ ! -d $udev_root ]; then + echo "${0}: udev_root \"$udev_root\" not found" + exit 1 + fi + grep -q "^udev $udev_root" /proc/mounts || + mount -t ramfs udev $udev_root || + exit 1 + + mkdir $udev_root/pts $udev_root/shm + + # populate /dev (normally) + echo -n "Populating $udev_root using udev: " + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + $UDEV_BIN -d || (echo "FAIL" && exit 1) + $UDEVSTART_BIN || (echo "FAIL" && exit 1) + echo "done" + ;; + stop) + # Stop execution of events + udevcontrol stop_exec_queue + killall udevd + ;; + *) + echo "Usage: $0 {start|stop}" + exit 1 + ;; +esac + + +exit 0 diff --git a/package/udev/init-udev b/package/udev/init-udev deleted file mode 100755 index 220fbcef6e..0000000000 --- a/package/udev/init-udev +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh -# -# udev This is a minimal non-LSB version of a UDEV startup script. It -# was derived by stripping down the udev-058 LSB version for use -# with buildroot on embedded hardware using Linux 2.6.12+ kernels. -# -# You may need to customize this for your system's resource limits -# (including startup time!) and administration. For example, if -# your early userspace has a custom initramfs or initrd you might -# need /dev much earlier; or without hotpluggable busses (like USB, -# PCMCIA, MMC/SD, and so on) your /dev might be static after boot. -# -# This script assumes your system boots right into the eventual root -# filesystem, and that init runs this udev script before any programs -# needing more device nodes than the bare-bones set -- /dev/console, -# /dev/zero, /dev/null -- that's needed to boot and run this script. -# - -# old kernels don't use udev -case $(uname -r) in - 2.6*|2.7*) ;; - *) exit 0;; -esac - -# Check for missing binaries -UDEV_BIN=/sbin/udevd -test -x $UDEV_BIN || exit 5 -UDEVSTART_BIN=/sbin/udevstart -test -x $UDEVSTART_BIN || exit 5 - -# Check for config file and read it -UDEV_CONFIG=/etc/udev/udev.conf -test -r $UDEV_CONFIG || exit 6 -. $UDEV_CONFIG - -# Directory where sysfs is mounted -SYSFS_DIR=/sys - -case "$1" in - start) - # mount sysfs if it's not yet mounted - if [ ! -d $SYSFS_DIR ]; then - echo "${0}: SYSFS_DIR \"$SYSFS_DIR\" not found" - exit 1 - fi - grep -q "^sysfs $SYSFS_DIR" /proc/mounts || - mount -t sysfs /sys /sys || - exit 1 - - # mount $udev_root as ramfs if it's not yet mounted - # we know 2.6 kernels always support ramfs - if [ ! -d $udev_root ]; then - echo "${0}: udev_root \"$udev_root\" not found" - exit 1 - fi - grep -q "^udev $udev_root" /proc/mounts || - mount -t ramfs udev $udev_root || - exit 1 - - mkdir $udev_root/pts $udev_root/shm - - # populate /dev (normally) - echo -n "Populating $udev_root using udev: " - echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug - $UDEV_BIN -d || (echo "FAIL" && exit 1) - $UDEVSTART_BIN || (echo "FAIL" && exit 1) - echo "done" - ;; - stop) - # Stop execution of events - udevcontrol stop_exec_queue - killall udevd - ;; - *) - echo "Usage: $0 {start|stop}" - exit 1 - ;; -esac - - -exit 0 diff --git a/package/udev/udev.mk b/package/udev/udev.mk index d33d6b4018..52b99efeac 100644 --- a/package/udev/udev.mk +++ b/package/udev/udev.mk @@ -45,7 +45,7 @@ $(TARGET_DIR)/$(UDEV_TARGET_BINARY): $(UDEV_DIR)/$(UDEV_BINARY) LDFLAGS="-warn-common" \ USE_LOG=false USE_SELINUX=false \ udevdir=$(UDEV_ROOT) -C $(UDEV_DIR) install - $(INSTALL) -m 0755 -D package/udev/init-udev $(TARGET_DIR)/etc/init.d/S10udev + $(INSTALL) -m 0755 -D package/udev/S10udev $(TARGET_DIR)/etc/init.d rm -rf $(TARGET_DIR)/usr/share/man ifneq ($(strip $(BR2_PACKAGE_UDEV_UTILS)),y) rm -f $(TARGET_DIR)/usr/sbin/udevmonitor -- cgit v1.2.1