wok-current rev 620

busybox: dnsd inetd udhcpd startup scripts
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 19 19:31:00 2008 +0000 (2008-04-19)
parents 87b81df312aa
children 6a9428a46323
files busybox/receipt busybox/stuff/dnsd busybox/stuff/inetd busybox/stuff/inetd.conf busybox/stuff/udhcpd
line diff
     1.1 --- a/busybox/receipt	Sat Apr 19 12:12:21 2008 +0000
     1.2 +++ b/busybox/receipt	Sat Apr 19 19:31:00 2008 +0000
     1.3 @@ -31,12 +31,16 @@
     1.4  genpkg_rules()
     1.5  {
     1.6      cp -a $src/_install/* $fs
     1.7 -    mkdir $fs/etc
     1.8 +    mkdir -p $fs/etc/init.d
     1.9      # Busybox config files.
    1.10      cp stuff/busybox.conf $fs/etc
    1.11      chmod 600 $fs/etc/busybox.conf
    1.12      cp stuff/dnsd.conf $fs/etc
    1.13      cp stuff/udhcpd.conf $fs/etc
    1.14 +    cp stuff/inetd.conf $fs/etc
    1.15 +    cp stuff/dnsd $fs/etc/init.d
    1.16 +    cp stuff/udhcpd $fs/etc/init.d
    1.17 +    cp stuff/inetd $fs/etc/init.d
    1.18      cd $fs
    1.19      rm linuxrc
    1.20      ln -s bin/busybox init
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/busybox/stuff/dnsd	Sat Apr 19 19:31:00 2008 +0000
     2.3 @@ -0,0 +1,57 @@
     2.4 +#!/bin/sh
     2.5 +# /etc/init.d/dnsd: Start, stop and restart DNS deamon on SliTaz, at boot
     2.6 +# time or with the command line.
     2.7 +#
     2.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    2.10 +#
    2.11 +. /etc/init.d/rc.functions
    2.12 +. /etc/daemons.conf
    2.13 +
    2.14 +NAME=Dnsd
    2.15 +DESC="DNS deamon"
    2.16 +DAEMON=/usr/sbin/dnsd
    2.17 +OPTIONS=$DNSD_OPTIONS
    2.18 +PIDFILE=/var/run/dnsd.pid
    2.19 +
    2.20 +case "$1" in
    2.21 +  start)
    2.22 +    if [ -f $PIDFILE ] ; then
    2.23 +      echo "$NAME already running."
    2.24 +      exit 1
    2.25 +    fi
    2.26 +    echo -n "Starting $DESC: $NAME... "
    2.27 +    $DAEMON $OPTIONS 
    2.28 +    status
    2.29 +    ;;
    2.30 +  stop)
    2.31 +    if [ ! -f $PIDFILE ] ; then
    2.32 +      echo "$NAME is not running."
    2.33 +      exit 1
    2.34 +    fi
    2.35 +    echo -n "Stopping $DESC: $NAME... "
    2.36 +    kill `cat $PIDFILE`
    2.37 +    rm $PIDFILE
    2.38 +    status
    2.39 +    ;;
    2.40 +  restart)
    2.41 +    if [ ! -f $PIDFILE ] ; then
    2.42 +      echo "$NAME is not running."
    2.43 +      exit 1
    2.44 +    fi
    2.45 +    echo -n "Restarting $DESC: $NAME... "
    2.46 +    kill `cat $PIDFILE`
    2.47 +    rm $PIDFILE
    2.48 +    sleep 2
    2.49 +    $DAEMON $OPTIONS
    2.50 +    status
    2.51 +    ;;
    2.52 +  *)
    2.53 +    echo ""
    2.54 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    2.55 +    echo ""
    2.56 +    exit 1
    2.57 +    ;;
    2.58 +esac
    2.59 +
    2.60 +exit 0
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/busybox/stuff/inetd	Sat Apr 19 19:31:00 2008 +0000
     3.3 @@ -0,0 +1,55 @@
     3.4 +#!/bin/sh
     3.5 +# /etc/init.d/inetd: Start, stop and restart Inet deamon on SliTaz, at boot
     3.6 +# time or with the command line.
     3.7 +#
     3.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     3.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    3.10 +#
    3.11 +. /etc/init.d/rc.functions
    3.12 +. /etc/daemons.conf
    3.13 +
    3.14 +NAME=Inetd
    3.15 +DESC="inetd deamon"
    3.16 +DAEMON=/usr/sbin/inetd
    3.17 +OPTIONS=$INETD_OPTIONS
    3.18 +PIDFILE=/var/run/inetd.pid
    3.19 +
    3.20 +case "$1" in
    3.21 +  start)
    3.22 +    if [ -f $PIDFILE ] ; then
    3.23 +      echo "$NAME already running."
    3.24 +      exit 1
    3.25 +    fi
    3.26 +    echo -n "Starting $DESC: $NAME... "
    3.27 +    $DAEMON $OPTIONS 
    3.28 +    status
    3.29 +    ;;
    3.30 +  stop)
    3.31 +    if [ ! -f $PIDFILE ] ; then
    3.32 +      echo "$NAME is not running."
    3.33 +      exit 1
    3.34 +    fi
    3.35 +    echo -n "Stopping $DESC: $NAME... "
    3.36 +    kill `cat $PIDFILE`
    3.37 +    status
    3.38 +    ;;
    3.39 +  restart)
    3.40 +    if [ ! -f $PIDFILE ] ; then
    3.41 +      echo "$NAME is not running."
    3.42 +      exit 1
    3.43 +    fi
    3.44 +    echo -n "Restarting $DESC: $NAME... "
    3.45 +    kill `cat $PIDFILE`
    3.46 +    sleep 2
    3.47 +    $DAEMON $OPTIONS
    3.48 +    status
    3.49 +    ;;
    3.50 +  *)
    3.51 +    echo ""
    3.52 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    3.53 +    echo ""
    3.54 +    exit 1
    3.55 +    ;;
    3.56 +esac
    3.57 +
    3.58 +exit 0
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/busybox/stuff/inetd.conf	Sat Apr 19 19:31:00 2008 +0000
     4.3 @@ -0,0 +1,31 @@
     4.4 +# Internet server configuration database
     4.5 +#
     4.6 +#
     4.7 +# If you want to disable an entry so it isn't touched during
     4.8 +# package updates just comment it out with a single '#' character.
     4.9 +#
    4.10 +# If you make changes to this file, either reboot your machine or
    4.11 +# send the inetd process a HUP signal:
    4.12 +# Do a "ps x" as root and look up the pid of inetd. Then do a
    4.13 +#     kill -HUP <pid of inetd>
    4.14 +# inetd will re-read this file whenever it gets that signal.
    4.15 +# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
    4.16 +#
    4.17 +#:INTERNAL: Internal services
    4.18 +# It is generally considered safer to keep these off.
    4.19 +echo     stream  tcp	nowait	root	internal
    4.20 +echo     dgram   udp	wait	root	internal
    4.21 +#discard  stream  tcp	nowait	root	internal
    4.22 +#discard  dgram   udp	wait	root	internal
    4.23 +daytime  stream  tcp	nowait	root	internal
    4.24 +daytime  dgram   udp	wait	root	internal
    4.25 +#chargen  stream  tcp	nowait	root	internal
    4.26 +#chargen  dgram   udp	wait	root	internal
    4.27 +time     stream  tcp	nowait	root	internal
    4.28 +time     dgram   udp	wait	root	internal
    4.29 +
    4.30 +# These are standard services.
    4.31 +#
    4.32 +tftp	dgram	udp	wait	root	/usr/bin/tftpd	/usr/bin/tftpd -r /boot
    4.33 +#systat	stream	tcp	nowait	nobody	/bin/ps
    4.34 +#netstat	stream	tcp	nowait	root	/bin/netstat	/bin/netstat	-a
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/busybox/stuff/udhcpd	Sat Apr 19 19:31:00 2008 +0000
     5.3 @@ -0,0 +1,55 @@
     5.4 +#!/bin/sh
     5.5 +# /etc/init.d/udhcpd: Start, stop and restart Udhcp deamon on SliTaz, at boot
     5.6 +# time or with the command line.
     5.7 +#
     5.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     5.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    5.10 +#
    5.11 +. /etc/init.d/rc.functions
    5.12 +. /etc/daemons.conf
    5.13 +
    5.14 +NAME=Udhcpd
    5.15 +DESC="udhcp deamon"
    5.16 +DAEMON=/usr/sbin/udhcpd
    5.17 +OPTIONS=$UDHCPD_OPTIONS
    5.18 +PIDFILE=/var/run/udhcpd.pid
    5.19 +
    5.20 +case "$1" in
    5.21 +  start)
    5.22 +    if [ -f $PIDFILE ] ; then
    5.23 +      echo "$NAME already running."
    5.24 +      exit 1
    5.25 +    fi
    5.26 +    echo -n "Starting $DESC: $NAME... "
    5.27 +    $DAEMON $OPTIONS 
    5.28 +    status
    5.29 +    ;;
    5.30 +  stop)
    5.31 +    if [ ! -f $PIDFILE ] ; then
    5.32 +      echo "$NAME is not running."
    5.33 +      exit 1
    5.34 +    fi
    5.35 +    echo -n "Stopping $DESC: $NAME... "
    5.36 +    kill `cat $PIDFILE`
    5.37 +    status
    5.38 +    ;;
    5.39 +  restart)
    5.40 +    if [ ! -f $PIDFILE ] ; then
    5.41 +      echo "$NAME is not running."
    5.42 +      exit 1
    5.43 +    fi
    5.44 +    echo -n "Restarting $DESC: $NAME... "
    5.45 +    kill `cat $PIDFILE`
    5.46 +    sleep 2
    5.47 +    $DAEMON $OPTIONS
    5.48 +    status
    5.49 +    ;;
    5.50 +  *)
    5.51 +    echo ""
    5.52 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    5.53 +    echo ""
    5.54 +    exit 1
    5.55 +    ;;
    5.56 +esac
    5.57 +
    5.58 +exit 0