[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#537623: Patch to add binary packages for providing busybox syslogd/klogd, udhcpc, and udhcpd



reassign 537623 busybox 1:1.13.3-1
retitle 537623 busybox: Please add binary packages for providing syslogd, udhcpc, and udhcpd.
tag 537623 + patch
kthxbye

Hi,

as already discussed on #debian-boot and in the bugreports #537623 and
#503529, the current idea is to integrate the packaging of symlinks to
busybox for using its syslogd, klogd, logread, udhcpc, udhcpd and
dumpleases applets instead of creating a standalone source package
doing that.

Attached the patch against the current SVN version (r59800).

Some remarks:

1. In accordance with Otavio I renamed and moved one file he recently
   added to the package, so before applying the patch the following
   commands must be issued:

   $ svn mkdir debian/share
   $ svn mv debian/bin/default.script debian/share/udeb.script

2. The busybox-syslogd package currently has two init.d scripts, one
   for syslogd and one for klogd. Some people may prefer a single
   init.d script for both daemons. If this is wanted, I can provide an
   updated patch.

3. The patch also includes transitional packages udhcpc and udhcpd to
   move away from the outdated udhcp source package. See #503529 for
   details on the outdated and orphaned udhcp source package which
   will be obsoleted by this patch. This patch is in accordance with
   Luca Capello's ITA and will resolve it.

I'm subscribed to debian-boot@l.d.o, so I should get any bugreports
filed against the busybox package (and especially the newly introduced
binary packages) and can work on those which cover this part of the
package.

Thanks to Otavio for many suggestions and his time at DebConf9.

		Regards, Axel
-- 
Axel Beckert - abe@deuxchevaux.org, abe@noone.org - http://noone.org/abe/
Index: debian/busybox-udhcpd.links
===================================================================
--- debian/busybox-udhcpd.links	(revision 0)
+++ debian/busybox-udhcpd.links	(revision 0)
@@ -0,0 +1,4 @@
+bin/busybox usr/sbin/udhcpd
+bin/busybox usr/bin/dumpleases
+usr/share/man/man1/busybox.1.gz usr/share/man/man1/dumpleases.1.gz
+usr/share/man/man1/busybox.1.gz usr/share/man/man8/udhcpd.8.gz
Index: debian/busybox-syslogd.init
===================================================================
--- debian/busybox-syslogd.init	(revision 0)
+++ debian/busybox-syslogd.init	(revision 0)
@@ -0,0 +1,161 @@
+#!/bin/sh
+#
+# init.d script with LSB support.
+#
+# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
+# Copyright (c) 2008 Axel Beckert <abe@deuxchevaux.org>
+#
+# This is free software; you may redistribute it and/or modify
+# it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2,
+# or (at your option) any later version.
+#
+# This is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License with
+# the Debian operating system, in /usr/share/common-licenses/GPL;  if
+# not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+#
+### BEGIN INIT INFO
+# Provides:          syslogd
+# Required-Start:    
+# Required-Stop:
+# Should-Start:      
+# Should-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Starts syslogd
+# Description:       Starts the busybox syslogd
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+NAME=syslogd         # Introduce the short server's name here
+DAEMON=/sbin/$NAME # Introduce the server's location here
+DESC="busybox' $NAME implementation" # Introduce a short description here
+NEEDED_OPTS=''
+DAEMON_USER='root'
+
+test -x $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+# Default options, these can be overriden by the information
+# at /etc/default/$NAME
+SYSLOG_OPTS=""          # Additional options given to the server
+
+DIETIME=10              # Time to wait for the server to die, in seconds
+                        # If this value is set too low you might not
+                        # let some servers to die gracefully and
+                        # 'restart' will not work
+
+#STARTTIME=2             # Time to wait for the server to start, in seconds
+                        # If this value is set each time the server is
+                        # started (on start or restart) the script will
+                        # stall to try to determine if it is running
+                        # If it is not set and the server takes time
+                        # to setup a pid file the log message might 
+                        # be a false positive (says it did not start
+                        # when it actually did)
+                        
+# Include defaults if available
+if [ -f /etc/default/busybox-syslogd ] ; then
+	. /etc/default/busybox-syslogd
+fi
+
+set -e
+
+start_server() {
+	start-stop-daemon --start --verbose --name $NAME \
+		--exec $DAEMON -- $NEEDED_OPTS $SYSLOG_OPTS
+}
+
+stop_server() {
+	start-stop-daemon --stop --quiet --name $NAME
+}
+
+running() {
+    cut -d ' ' -f 1-2 /proc/[0-9]*/stat | grep -F "($NAME)"
+}
+
+case "$1" in
+  start)
+	log_daemon_msg "Starting $DESC " "$NAME"
+        # Check if it's running first
+        if running ;  then
+            log_progress_msg "apparently already running"
+            log_end_msg 0
+            exit 0
+        fi
+        if start_server ; then
+            # NOTE: Some servers might die some time after they start,
+            # this code will detect this issue if STARTTIME is set
+            # to a reasonable value
+            [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time 
+            if  running ;  then
+                # It's ok, the server started and is running
+                log_end_msg 0
+            else
+                # It is not running after we did start
+                log_end_msg 1
+            fi
+        else
+            # Either we could not start it
+            log_end_msg 1
+        fi
+        ;;
+  stop)
+        log_daemon_msg "Stopping $DESC" "$NAME"
+        if running ; then
+            # Only stop the server if we see it running
+			errcode=0
+            stop_server || errcode=$?
+            log_end_msg $errcode
+        else
+            # If it's not running don't do anything
+            log_progress_msg "apparently not running"
+            log_end_msg 0
+            exit 0
+        fi
+        ;;
+  restart|force-reload)
+        log_daemon_msg "Restarting $DESC" "$NAME"
+		errcode=0
+        stop_server || errcode=$?
+        # Wait some sensible amount, some server need this
+        [ -n "$DIETIME" ] && sleep $DIETIME
+        start_server || errcode=$?
+        [ -n "$STARTTIME" ] && sleep $STARTTIME
+        running || errcode=$?
+        log_end_msg $errcode
+        ;;
+  status)
+
+        log_daemon_msg "Checking status of $DESC" "$NAME"
+        if running ;  then
+            log_progress_msg "running"
+            log_end_msg 0
+        else
+            log_progress_msg "apparently not running"
+            log_end_msg 1
+            exit 1
+        fi
+        ;;
+  # daemon cannot reload
+  reload)
+        log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
+        log_warning_msg "cannot re-read the config file (use restart)."
+        ;;
+
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+	exit 1
+        ;;
+esac
+
+exit 0
Index: debian/control
===================================================================
--- debian/control	(revision 59800)
+++ debian/control	(working copy)
@@ -20,10 +20,12 @@
  provide the expected functionality and behave very much like their GNU
  counterparts.
  .
- This package installs the BusyBox binary but does not install symlinks
- for any of the supported utilities. You can use /bin/busybox --install
- to install BusyBox to the current directory (you do not want to do this
- in / on your Debian system!).
+ This package installs the BusyBox binary but does not install
+ symlinks for any of the supported utilities. Some of the utilities
+ can be used in the system by installing the busybox-syslogd,
+ busybox-udhcpc or busybox-udhcpd packages. You can also use
+ /bin/busybox --install to install BusyBox to the current directory
+ (but you do not want to do this in / on your Debian system!)
 
 Package: busybox-static
 Architecture: any
@@ -67,3 +69,69 @@
  the debian-installer, this package is not for you. Installing this 
  on your Debian system is a very, very bad idea. You have been warned.
 
+Package: busybox-syslogd
+Architecture: all
+Depends: busybox | busybox-static
+Provides: linux-kernel-log-daemon, system-log-daemon, klogd, syslogd
+Replaces: sysklogd, klogd, inetutils-syslogd
+Conflicts: klogd, syslogd, sysklogd, linux-kernel-log-daemon, system-log-daemon
+Description: Provides syslogd and klogd using busybox
+ The system log daemon is responsible for providing logging of
+ messages received from programs and facilities on the local host as
+ well as from remote hosts.
+ .
+ The kernel log daemon listens to kernel message sources and is
+ responsible for prioritizing and processing operating system
+ messages.
+ .
+ The busybox implementation of the syslogd is particular useful on
+ embedded, diskless (netboot) or flash disk based systems because it
+ can use a fixed size ring buffer for logging instead of saving logs
+ to the disk or sending it to remote logging servers. The ring buffer
+ can be read using the (also busybox based) command logread.
+ .
+ This package provides the glue to the busybox syslogd and klogd to be
+ used in the system by providing the appropriate symbolic links and
+ scripts.
+
+Package: busybox-udhcpc
+Architecture: all
+Depends: busybox (>= ${source:Version}) | busybox-static (>= ${source:Version})
+Provides: udhcpc
+Replaces: udhcpc (<< 1:1.13.3-1)
+Conflicts: udhcpc (<< 1:1.13.3-1)
+Description: Provides the busybox DHCP client implementation
+ Busybox contains a very small yet fully function RFC compliant DHCP
+ client formerly known as udhcpc.
+ .
+ This package contains the glue to use the busybox udhcpc as DHCP
+ client in the system by providing the appropriate symbolic links and
+ scripts.
+
+Package: udhcpc
+Architecture: all
+Depends: busybox-udhcpc
+Description: Transitional package to busybox-udhcpc
+ The sole purpose of this package is to pull in the new busybox-udhcpc
+ package which uses the udhcpc component of the busybox package.
+
+Package: busybox-udhcpd
+Architecture: all
+Depends: busybox (>= ${source:Version}) | busybox-static (>= ${source:Version})
+Provides: udhcpd, dhcpd, dhcp3-server
+Replaces: udhcpd (<< 1:1.13.3-1)
+Conflicts: udhcpd (<< 1:1.13.3-1)
+Description: Provides the busybox DHCP server implementation
+ Busybox contains a very small yet fully function RFC compliant DHCP
+ server formerly known as udhcpd.
+ .
+ This package contains the glue to use the busybox udhcpd as DHCP
+ server in the system by providing the appropriate symbolic links and
+ scripts.
+
+Package: udhcpd
+Architecture: all
+Depends: busybox-udhcpd
+Description: Transitional package to busybox-udhcpd
+ The sole purpose of this package is to pull in the new busybox-udhcpd
+ package which uses the udhcpd component of the busybox package.
Index: debian/busybox-udhcpd.default
===================================================================
--- debian/busybox-udhcpd.default	(revision 0)
+++ debian/busybox-udhcpd.default	(revision 0)
@@ -0,0 +1,9 @@
+# Comment the following line to enable
+DHCPD_ENABLED="no"
+
+# Options to pass to busybox' udhcpd.
+#
+# -S    Log to syslog
+# -f    run in foreground
+
+DHCPD_OPTS="-S"
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 59800)
+++ debian/changelog	(working copy)
@@ -7,6 +7,17 @@
   [ Otavio Salvador ]
   * [udeb] Add an udhcpc script to be used by netcfg.
 
+  [ Axel Beckert ]
+  * Add binary packages containing symbolic links for
+    syslogd/klogd/logread. (Closes: #537623)
+  * Add binary packages containing symbolic links for udhcpc and udhcpd plus
+    configuration (based on the old udhcp source package).
+  * Added transtional packages to replace udhcpc and udhcpd by
+    busybox-udhcpc and busybox-udhcpd. (Closes: #503529)
+  * Enabled PID file support in normal and static build (needed for at
+    least udhcpc and udhcpd in a non-volatile environment)
+  * Fixed typo in copyright file
+  
  -- Otavio Salvador <otavio@ossystems.com.br>  Sun, 19 Jul 2009 14:43:18 -0300
 
 busybox (1:1.13.3-1) unstable; urgency=low
Index: debian/busybox-udhcpd.manpages
===================================================================
--- debian/busybox-udhcpd.manpages	(revision 0)
+++ debian/busybox-udhcpd.manpages	(revision 0)
@@ -0,0 +1 @@
+debian/udhcpd.conf.5
Index: debian/rules
===================================================================
--- debian/rules	(revision 59800)
+++ debian/rules	(working copy)
@@ -42,6 +42,11 @@
 	$(MAKE) -C '$(DIR)' install docs/busybox.1 BB_EXTRA_VERSION="$(shell lsb_release -is) $(VERSION_DEBIAN)"
 	touch $@
 
+$(STAMPS_DIR)/indepbuild_%: DIR=$(BUILD_DIR)/indepbuild_$*
+$(STAMPS_DIR)/indepbuild_%: 
+	dh_testdir
+	touch $@
+
 $(BUILD_DIR) $(STAMPS_DIR):
 	@[ -d $@ ] || mkdir $@
 
@@ -53,7 +58,9 @@
 	rm -rf $(BUILD_DIR) $(STAMPS_DIR)
 	dh_clean
 
-binary-indep:
+binary-indep: binary-indep_syslogd \
+	      binary-indep_udhcpc binary-indep_udhcpc-transitional \
+	      binary-indep_udhcpd binary-indep_udhcpd-transitional
 
 binary-arch: binary-arch_deb binary-arch_static binary-arch_udeb
 
@@ -106,6 +113,70 @@
 	dh_md5sums
 	dh_builddeb
 
+binary-indep_syslogd: PACKAGE = busybox-syslogd
+binary-indep_syslogd: export DH_OPTIONS = -p$(PACKAGE)
+binary-indep_syslogd: $(STAMPS_DIR)/indepbuild_syslogd
+	dh_testdir
+	dh_testroot
+	dh_clean -k -d
+	dh_link
+	dh_installinit -u"defaults 10 90"
+	dh_installinit -u"defaults 11 89" --name=busybox-klogd
+	$(MAKE) -f debian/rules binary-indep_all
+
+binary-indep_udhcpc: PACKAGE = busybox-udhcpc
+binary-indep_udhcpc: OUT_DIR = $(CURDIR)/debian/$(PACKAGE)
+binary-indep_udhcpc: export DH_OPTIONS = -p$(PACKAGE)
+binary-indep_udhcpc: $(STAMPS_DIR)/indepbuild_udhcpc
+	dh_testdir
+	dh_testroot
+	dh_clean -k -d
+	dh_link
+	install -d -m755 $(OUT_DIR)/usr/share/udhcpc
+	install -m755 $(CURDIR)/debian/share/default.script $(OUT_DIR)/usr/share/udhcpc/
+	$(MAKE) -f debian/rules binary-indep_all
+
+binary-indep_udhcpc-transitional: PACKAGE = udhcpc
+binary-indep_udhcpc-transitional: export DH_OPTIONS = -p$(PACKAGE)
+binary-indep_udhcpc-transitional: $(STAMPS_DIR)/indepbuild_udhcpc-transitional
+	dh_testdir
+	dh_testroot
+	dh_clean -k -d
+	$(MAKE) -f debian/rules binary-indep_all
+
+binary-indep_udhcpd: PACKAGE = busybox-udhcpd
+binary-indep_udhcpd: OUT_DIR = $(CURDIR)/debian/$(PACKAGE)
+binary-indep_udhcpd: export DH_OPTIONS = -p$(PACKAGE)
+binary-indep_udhcpd: $(STAMPS_DIR)/indepbuild_udhcpd
+	dh_testdir
+	dh_testroot
+	dh_clean -k -d
+	dh_link
+	install -d -m755 $(OUT_DIR)/etc
+	install -m644 $(CURDIR)/debian/udhcpd.conf $(OUT_DIR)/etc/
+	dh_installman
+	dh_installinit
+	$(MAKE) -f debian/rules binary-indep_all
+
+binary-indep_udhcpd-transitional: PACKAGE = udhcpd
+binary-indep_udhcpd-transitional: export DH_OPTIONS = -p$(PACKAGE)
+binary-indep_udhcpd-transitional: $(STAMPS_DIR)/indepbuild_udhcpd-transitional
+	dh_testdir
+	dh_testroot
+	dh_clean -k -d
+	$(MAKE) -f debian/rules binary-indep_all
+
+binary-indep_all:
+	dh_installdirs
+	dh_installdocs
+	dh_installchangelogs
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
 binary: binary-indep binary-arch
 
 DIR_ORIG = ../orig/$(SOURCE)-$(VERSION)
Index: debian/udhcpd.conf
===================================================================
--- debian/udhcpd.conf	(revision 0)
+++ debian/udhcpd.conf	(revision 0)
@@ -0,0 +1,123 @@
+# Sample udhcpd configuration file (/etc/udhcpd.conf)
+
+# The start and end of the IP lease block
+
+start		192.168.0.20	#default: 192.168.0.20
+end		192.168.0.254	#default: 192.168.0.254
+
+
+# The interface that udhcpd will use
+
+interface	eth0		#default: eth0
+
+
+# The maximim number of leases (includes addressesd reserved
+# by OFFER's, DECLINE's, and ARP conficts
+
+#max_leases	254		#default: 254
+
+
+# If remaining is true (default), udhcpd will store the time
+# remaining for each lease in the udhcpd leases file. This is
+# for embedded systems that cannot keep time between reboots.
+# If you set remaining to no, the absolute time that the lease
+# expires at will be stored in the dhcpd.leases file.
+
+#remaining	yes		#default: yes
+
+
+# The time period at which udhcpd will write out a dhcpd.leases
+# file. If this is 0, udhcpd will never automatically write a
+# lease file. (specified in seconds)
+
+#auto_time	7200		#default: 7200 (2 hours)
+
+
+# The amount of time that an IP will be reserved (leased) for if a
+# DHCP decline message is received (seconds).
+
+#decline_time	3600		#default: 3600 (1 hour)
+
+
+# The amount of time that an IP will be reserved (leased) for if an
+# ARP conflct occurs. (seconds
+
+#conflict_time	3600		#default: 3600 (1 hour)
+
+
+# How long an offered address is reserved (leased) in seconds
+
+#offer_time	60		#default: 60 (1 minute)
+
+# If a lease to be given is below this value, the full lease time is
+# instead used (seconds).
+
+#min_lease	60		#defult: 60
+
+
+# The location of the leases file
+
+#lease_file	/var/lib/misc/udhcpd.leases	#defualt: /var/lib/misc/udhcpd.leases
+
+# The location of the pid file
+#pidfile	/var/run/udhcpd.pid	#default: /var/run/udhcpd.pid
+
+# Everytime udhcpd writes a leases file, the below script will be called.
+# Useful for writing the lease file to flash every few hours.
+
+#notify_file				#default: (no script)
+
+#notify_file	dumpleases	# <--- useful for debugging
+
+# The following are bootp specific options, setable by udhcpd.
+
+#siaddr		192.168.0.22		#default: 0.0.0.0
+
+#sname		zorak			#default: (none)
+
+#boot_file	/var/nfs_root		#default: (none)
+
+# The remainer of options are DHCP options and can be specifed with the
+# keyword 'opt' or 'option'. If an option can take multiple items, such
+# as the dns option, they can be listed on the same line, or multiple
+# lines. The only option with a default is 'lease'.
+
+#Examles
+opt	dns	192.168.10.2 192.168.10.10
+option	subnet	255.255.255.0
+opt	router	192.168.10.2
+opt	wins	192.168.10.10
+option	dns	129.219.13.81	# appened to above DNS servers for a total of 3
+option	domain	local
+option	lease	864000		# 10 days of seconds
+
+
+# Currently supported options, for more info, see options.c
+#opt subnet
+#opt timezone
+#opt router
+#opt timesrv
+#opt namesrv
+#opt dns
+#opt logsrv
+#opt cookiesrv
+#opt lprsrv
+#opt bootsize
+#opt domain
+#opt swapsrv
+#opt rootpath
+#opt ipttl
+#opt mtu
+#opt broadcast
+#opt wins
+#opt lease
+#opt ntpsrv
+#opt tftp
+#opt bootfile
+#opt wpad
+
+# Static leases map
+#static_lease 00:60:08:11:CE:4E 192.168.0.54
+#static_lease 00:60:08:11:CE:3E 192.168.0.44
+
+
Index: debian/busybox-syslogd.links
===================================================================
--- debian/busybox-syslogd.links	(revision 0)
+++ debian/busybox-syslogd.links	(revision 0)
@@ -0,0 +1,6 @@
+bin/busybox bin/logread
+bin/busybox sbin/klogd
+bin/busybox sbin/syslogd
+usr/share/man/man1/busybox.1.gz usr/share/man/man1/logread.1.gz
+usr/share/man/man1/busybox.1.gz usr/share/man/man8/klogd.8.gz
+usr/share/man/man1/busybox.1.gz usr/share/man/man8/syslogd.8.gz
Index: debian/udhcpd.conf.5
===================================================================
--- debian/udhcpd.conf.5	(revision 0)
+++ debian/udhcpd.conf.5	(revision 0)
@@ -0,0 +1,166 @@
+.TH UDHCPD.CONF 5 2001-09-26 GNU/Linux "GNU/Linux Administrator's Manual"
+.SH NAME
+udhcpd.conf \- udhcp server configuration file
+.SH DESCRIPTION
+The file
+.I /etc/udhcpd.conf
+contains configuration information specific to the udhcp server.
+It should contain one configuration keyword per line, followed by
+appropriate configuration information.
+.SH OPTIONS
+.TP
+.BI start\  ADDRESS
+The starting address of the IP lease block is
+.IR ADDRESS .
+The default is
+.BR 192.168.0.20 .
+.TP
+.BI end\  ADDRESS
+The ending address of the IP lease block is
+.IR ADDRESS .
+The default is
+.BR 192.168.0.254 .
+.TP
+.BI interface\  INTERFACE
+The udhcp server should listen on
+.IR INTERFACE .
+The default is
+.BR eth0 .
+.TP
+.BI max_leases\  LEASES
+Offer at most
+.I LEASES
+leases (including those reserved by OFFERs, DECLINEs, and ARP
+conflicts).  The default is
+.BR 254 .
+.TP 
+.BI remaining\  REMAINING
+If
+.I REMAINING
+is
+.BR yes ,
+store the time remaining for each lease.  If it is
+.BR no ,
+store the expiration time for each lease.  The default is
+.BR yes .
+.TP
+.BI auto_time\  SECONDS
+Write the lease information to a file every
+.I SECONDS
+seconds.  The default is
+.BR 7200 .
+.TP
+.BI decline_time\  SECONDS
+Reserve an IP for
+.I SECONDS
+seconds if a DHCP decline message is received.  The default is
+.BR 3600 .
+.TP
+.BI conflict_time\  SECONDS
+Reserve an IP for
+.I SECONDS
+seconds if an ARP conflict occurs.  The default is
+.BR 3600 .
+.TP
+.BI offer_time\  SECONDS
+Reserve an IP for
+.I SECONDS
+seconds if it is offered.  The default is
+.BR 60 .
+.TP
+.BI min_lease\  SECONDS
+Reserve an IP for the full lease time if the lease to be given is less than
+.I SECONDS
+seconds.  The default is
+.BR 60 .
+.TP
+.BI lease_file\  FILE
+Write the lease information to
+.IR FILE .
+The default is
+.BR /var/lib/misc/udhcpd.leases .
+.TP
+.BI pidfile\  FILE
+Write the process ID to
+.IR FILE .
+The default is
+.BR /var/run/udhcpd.pid .
+.TP
+.BI notify_file\  FILE
+Execute
+.I FILE
+after the lease information is written.  By default, no file is executed.
+.TP
+.BI siaddr\  ADDRESS
+BOOTP specific option.  The default is
+.BR 0.0.0.0 .
+.TP
+.BI sname\  NAME
+BOOTP specific option.  There is no default.
+.TP
+.BI boot_file\  FILE
+BOOTP specific option.  There is no default.
+.TP
+.BI option\  OPTION
+DHCP specific option.
+.RS
+.TP
+.BI subnet\  ADDRESS
+.TP
+.BI timezone\  OFFSET
+.TP
+.BI router\  ADDRESS...
+.TP
+.BI timesvr\  ADDRESS...
+.TP
+.BI namesvr\  ADDRESS...
+.TP
+.BI dns\  ADDRESS...
+.TP
+.BI logsvr\  ADDRESS...
+.TP
+.BI cookiesvr\  ADDRESS...
+.TP
+.BI lprsvr\  ADDRESS...
+.TP
+.BI hostname\  HOSTNAME
+.TP
+.BI bootsize\  SIZE
+.TP
+.BI domain\  DOMAIN
+.TP
+.BI swapsvr\  ADDRESS
+.TP
+.BI rootpath\  PATH
+.TP
+.BI ipttl\  TTL
+.TP
+.BI mtu\  MTU
+.TP
+.BI broadcast\  ADDRESS
+.TP
+.BI ntpsrv\  ADDRESS...
+.TP
+.BI wins\  ADDRESS...
+.TP
+.BI requestip\  ADDRESS
+.TP
+.BI lease\  SECONDS
+.TP
+.BI dhcptype\  TYPE
+.TP
+.BI serverid\  ADDRESS
+.TP
+.BI tftp\  FILE
+.TP
+.BI wpad\ URL
+.TP
+.BI bootfile\  FILE
+The default for
+.B lease
+is
+.BR 864000 .
+There are no defaults for the other options.
+.RE
+.SH SEE ALSO
+.BR udhcpd (8).
Index: debian/busybox-syslogd.default
===================================================================
--- debian/busybox-syslogd.default	(revision 0)
+++ debian/busybox-syslogd.default	(revision 0)
@@ -0,0 +1,7 @@
+# Defaults for busybox-syslogd initscript
+# This is a POSIX shell fragment sourced by /etc/init.d/busybox-syslogd
+
+# Additional options that are passed to the daemons.  Default is to log
+# to ring buffer (to be read with logread(1)) and drop duplicates.
+SYSLOG_OPTS="-C128"
+KLOG_OPTS=""
Index: debian/busybox-udhcpd.init
===================================================================
--- debian/busybox-udhcpd.init	(revision 0)
+++ debian/busybox-udhcpd.init	(revision 0)
@@ -0,0 +1,61 @@
+#! /bin/sh
+#
+# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
+# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>
+# and Axel Beckert <abe@deuxchevaux.org>.
+#
+### BEGIN INIT INFO
+# Provides:          udhcpd
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start busybox udhcpd at boot time
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/udhcpd
+NAME=udhcpd
+DESC="very small Busybox based DHCP server"
+DHCPD_OPTS="-S" # Additional options given to the server
+
+test -x $DAEMON || exit 0
+
+# Include defaults if available
+if [ -f /etc/default/busybox-udhcpd ] ; then
+	. /etc/default/busybox-udhcpd
+fi
+
+if [ "$DHCPD_ENABLED" = "no" ]; then
+    echo $NAME: Disabled. Edit /etc/default/busybox-udhcpd to enable it.
+    exit 0;
+fi
+
+set -e
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	start-stop-daemon --start --verbose --pidfile /var/run/$NAME.pid \
+		--oknodo --exec $DAEMON -- $DHCPD_OPTS
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+	start-stop-daemon --stop --verbose --pidfile /var/run/$NAME.pid \
+		--oknodo --exec $DAEMON
+	echo "$NAME."
+	;;
+  restart|force-reload)
+	$0 start	
+	sleep 1
+	$0 stop
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
Index: debian/share/default.script
===================================================================
--- debian/share/default.script	(revision 0)
+++ debian/share/default.script	(revision 0)
@@ -0,0 +1,62 @@
+#!/bin/sh
+# Busybox udhcpc dispatcher script. Copyright (C) 2009 by Axel Beckert.
+#
+# Based on the busybox example scripts and the old udhcp source
+# package default.* scripts.
+
+RESOLV_CONF="/etc/resolv.conf"
+
+case $1 in
+    bound|renew)
+	[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+	[ -n "$subnet" ] && NETMASK="netmask $subnet"
+
+	/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
+
+	if [ -n "$router" ]; then
+	    echo "$0: Resetting default routes"
+	    while /sbin/route del default gw 0.0.0.0 dev $interface; do :; done
+
+	    metric=0
+	    for i in $router; do
+		/sbin/route add default gw $i dev $interface metric $((metric++))
+	    done
+	fi
+
+	# Update resolver configuration file
+	R=""
+	[ -n "$domain" ] && R="domain $domain
+"
+	for i in $dns; do
+	    echo "$0: Adding DNS $i"
+	    R="${R}nameserver $i
+"
+	done
+
+	if [ -x /sbin/resolvconf ]; then
+	    echo -n "$R" | resolvconf -a "${interface}.udhcpc"
+	else
+	    echo -n "$R" > "$RESOLV_CONF"
+	fi
+	;;
+
+    deconfig)
+	if [ -x /sbin/resolvconf ]; then
+	    resolvconf -d "${interface}.udhcpc"
+	fi
+	/sbin/ifconfig $interface 0.0.0.0
+	;;
+
+    leasefail)
+	echo "$0: Lease failed: $message"
+	;;
+
+    nak)
+	echo "$0: Received a NAK: $message"
+	;;
+
+    *)
+	echo "$0: Unknown udhcpc command: $1";
+	exit 1;
+	;;
+esac
Index: debian/config/static
===================================================================
--- debian/config/static	(revision 59800)
+++ debian/config/static	(working copy)
@@ -26,7 +26,7 @@
 CONFIG_GETOPT_LONG=y
 CONFIG_FEATURE_DEVPTS=y
 # CONFIG_FEATURE_CLEAN_UP is not set
-# CONFIG_FEATURE_PIDFILE is not set
+CONFIG_FEATURE_PIDFILE=y
 CONFIG_FEATURE_SUID=y
 CONFIG_FEATURE_SUID_CONFIG=y
 CONFIG_FEATURE_SUID_CONFIG_QUIET=y
Index: debian/config/deb
===================================================================
--- debian/config/deb	(revision 59800)
+++ debian/config/deb	(working copy)
@@ -26,7 +26,7 @@
 CONFIG_GETOPT_LONG=y
 CONFIG_FEATURE_DEVPTS=y
 # CONFIG_FEATURE_CLEAN_UP is not set
-# CONFIG_FEATURE_PIDFILE is not set
+CONFIG_FEATURE_PIDFILE=y
 CONFIG_FEATURE_SUID=y
 CONFIG_FEATURE_SUID_CONFIG=y
 CONFIG_FEATURE_SUID_CONFIG_QUIET=y
Index: debian/busybox-syslogd.busybox-klogd.init
===================================================================
--- debian/busybox-syslogd.busybox-klogd.init	(revision 0)
+++ debian/busybox-syslogd.busybox-klogd.init	(revision 0)
@@ -0,0 +1,158 @@
+#!/bin/sh
+#
+# init.d script with LSB support.
+#
+# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
+# Copyright (c) 2008 Axel Beckert <abe@deuxchevaux.org>
+#
+# This is free software; you may redistribute it and/or modify
+# it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2,
+# or (at your option) any later version.
+#
+# This is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License with
+# the Debian operating system, in /usr/share/common-licenses/GPL;  if
+# not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+#
+### BEGIN INIT INFO
+# Provides:          klogd
+# Required-Start:    
+# Required-Stop:
+# Should-Start:      syslogd
+# Should-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Starts klogd
+# Description:       Starts the busybox klogd
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+NAME=klogd         # Introduce the short server's name here
+DAEMON=/sbin/$NAME # Introduce the server's location here
+DESC="busybox' $NAME implementation" # Introduce a short description here
+NEEDED_OPTS=''
+DAEMON_USER='root'
+
+test -x $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+# Default options, these can be overriden by the information
+# at /etc/default/$NAME
+KLOG_OPTS=""            # Additional options given to the server
+
+DIETIME=10              # Time to wait for the server to die, in seconds
+                        # If this value is set too low you might not
+                        # let some servers to die gracefully and
+                        # 'restart' will not work
+
+STARTTIME=2             # Time to wait for the server to start, in seconds
+                        # If this value is set each time the server is
+                        # started (on start or restart) the script will
+                        # stall to try to determine if it is running
+                        # If it is not set and the server takes time
+                        # to setup a pid file the log message might 
+                        # be a false positive (says it did not start
+                        # when it actually did)
+                        
+# Include defaults if available
+if [ -f /etc/default/busybox-syslogd ] ; then
+	. /etc/default/busybox-syslogd
+fi
+
+set -e
+
+start_server() {
+	start-stop-daemon --start --verbose --name $NAME \
+		--exec $DAEMON -- $NEEDED_OPTS $KLOG_OPTS
+}
+
+stop_server() {
+	start-stop-daemon --stop --verbose --name $NAME
+}
+
+running() {
+    cut -d ' ' -f 1-2 /proc/[0-9]*/stat | grep -F "($NAME)"
+}
+
+case "$1" in
+  start)
+	log_daemon_msg "Starting $DESC " "$NAME"
+        # Check if it's running first
+        if running ;  then
+            log_progress_msg "apparently already running"
+            log_end_msg 0
+            exit 0
+        fi
+        if start_server ; then
+            # NOTE: Some servers might die some time after they start,
+            # this code will detect this issue if STARTTIME is set
+            # to a reasonable value
+            [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time 
+            if  running ;  then
+                # It's ok, the server started and is running
+                log_end_msg 0
+            else
+                # It is not running after we did start
+                log_end_msg 1
+            fi
+        else
+            # Either we could not start it
+            log_end_msg 1
+        fi
+	;;
+
+  stop)
+        log_daemon_msg "Stopping $DESC" "$NAME"
+        if running ; then
+            # Only stop the server if we see it running
+			errcode=0
+            stop_server || errcode=$?
+            log_end_msg $errcode
+        else
+            # If it's not running don't do anything
+            log_progress_msg "apparently not running"
+            log_end_msg 0
+            exit 0
+        fi
+        ;;
+
+  restart|force-reload)
+        log_daemon_msg "Restarting $DESC" "$NAME"
+		errcode=0
+        stop_server || errcode=$?
+        # Wait some sensible amount, some server need this
+        [ -n "$DIETIME" ] && sleep $DIETIME
+        start_server || errcode=$?
+        [ -n "$STARTTIME" ] && sleep $STARTTIME
+        running || errcode=$?
+        log_end_msg $errcode
+	;;
+
+  status)
+        log_daemon_msg "Checking status of $DESC" "$NAME"
+        if running ;  then
+            log_progress_msg "running"
+            log_end_msg 0
+        else
+            log_progress_msg "apparently not running"
+            log_end_msg 1
+            exit 1
+        fi
+        ;;
+
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
Index: debian/copyright
===================================================================
--- debian/copyright	(revision 59800)
+++ debian/copyright	(working copy)
@@ -3,11 +3,16 @@
 
 It was downloaded from ftp://ftp.busybox.net/busybox
 
-BusyBox is an agregate of multiple packages. These packages are copyrighted
+BusyBox is an aggregate of multiple packages. These packages are copyrighted
 by their respective authors.
 
 Copyright: 1999-2005 Erik Andersen
 
+udhcp packaging for Debian Copyright (C) 2001, 2002 Matt Kraai
+udhcp packaging for Debian Copyright (C) 2003 Eric Van Buggenhaut
+udhcp packaging for Debian Copyright (C) 2009 Axel Beckert
+syslogd packaging for Debian Copyright (C) 2008, 2009 Axel Beckert
+
 License:
 
    This package is free software; you can redistribute it and/or modify
Index: debian/busybox-udeb.install
===================================================================
--- debian/busybox-udeb.install	(revision 59800)
+++ debian/busybox-udeb.install	(working copy)
@@ -1,2 +1,2 @@
 _install/* /
-../../bin/default.script usr/share/udhcpc
+../../share/udeb.script usr/share/udhcpc/default.script
Index: debian/busybox-udhcpc.links
===================================================================
--- debian/busybox-udhcpc.links	(revision 0)
+++ debian/busybox-udhcpc.links	(revision 0)
@@ -0,0 +1,2 @@
+bin/busybox sbin/udhcpc
+usr/share/man/man1/busybox.1.gz usr/share/man/man8/udhcpc.8.gz

Reply to: