OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.4 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../udhcp/udhcpd-foreground.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- T2-COPYRIGHT-NOTE-END ---
  16. diff -Nudr udhcp.orig/dhcpd.c udhcp/dhcpd.c
  17. --- udhcp.orig/dhcpd.c 2000-01-01 00:00:00.000000000 -0300
  18. +++ udhcp/dhcpd.c 2005-02-13 19:17:48.604424267 -0300
  19. @@ -104,7 +104,9 @@
  20. return 1;
  21. #ifndef UDHCP_DEBUG
  22. - background(server_config.pidfile); /* hold lock during fork. */
  23. + if (!server_config.foreground) {
  24. + background(server_config.pidfile); /* hold lock during fork. */
  25. + }
  26. #endif
  27. /* Setup the signal pipe */
  28. diff -Nudr udhcp.orig/dhcpd.h udhcp/dhcpd.h
  29. --- udhcp.orig/dhcpd.h 2000-01-01 00:00:00.000000000 -0300
  30. +++ udhcp/dhcpd.h 2005-02-13 19:15:02.164551365 -0300
  31. @@ -128,6 +128,7 @@
  32. char *lease_file;
  33. char *pidfile;
  34. char *notify_file; /* What to run whenever leases are written */
  35. + char foreground; /* Run in foreground */
  36. uint32_t siaddr; /* next server bootp option */
  37. char *sname; /* bootp server name */
  38. char *boot_file; /* bootp boot file option */
  39. diff -Nudr udhcp.orig/files.c udhcp/files.c
  40. --- udhcp.orig/files.c 2000-01-01 00:00:00.000000000 -0300
  41. +++ udhcp/files.c 2005-02-13 19:13:47.311303959 -0300
  42. @@ -220,6 +220,7 @@
  43. {"lease_file", read_str, &(server_config.lease_file), LEASES_FILE},
  44. {"pidfile", read_str, &(server_config.pidfile), "/var/run/udhcpd.pid"},
  45. {"notify_file", read_str, &(server_config.notify_file), ""},
  46. + {"foreground", read_yn, &(server_config.foreground), "no"},
  47. {"siaddr", read_ip, &(server_config.siaddr), "0.0.0.0"},
  48. {"sname", read_str, &(server_config.sname), ""},
  49. {"boot_file", read_str, &(server_config.boot_file), ""},
  50. diff -Nudr udhcp.orig/samples/udhcpd.conf udhcp/samples/udhcpd.conf
  51. --- udhcp.orig/samples/udhcpd.conf 2000-01-01 00:00:00.000000000 -0300
  52. +++ udhcp/samples/udhcpd.conf 2005-02-13 19:13:03.000000000 -0300
  53. @@ -69,6 +69,13 @@
  54. #notify_file dumpleases # <--- usefull for debugging
  55. +# Normally udhcpd forks into the background after reading its
  56. +# configuration. The foreground option prevents this, which can be
  57. +# useful in some circumstances, such as when running directly from
  58. +# init.
  59. +
  60. +#foreground yes #default: no
  61. +
  62. # The following are bootp specific options, setable by udhcpd.
  63. #siaddr 192.168.0.22 #default: 0.0.0.0
  64. diff -Nudr udhcp.orig/udhcpd.conf.5 udhcp/udhcpd.conf.5
  65. --- udhcp.orig/udhcpd.conf.5 2000-01-01 00:00:00.000000000 -0300
  66. +++ udhcp/udhcpd.conf.5 2005-02-13 19:11:06.000000000 -0300
  67. @@ -91,6 +91,17 @@
  68. .I FILE
  69. after the lease information is written. By default, no file is executed.
  70. .TP
  71. +.BI foreground\ FOREGROUND
  72. +If
  73. +.I FOREGROUND
  74. +is
  75. +.BR no
  76. +(the default), fork into the background after reading the
  77. +configuration. If it is
  78. +.BR yes ,
  79. +run in the foreground, which can be useful in some
  80. +circumstances, such as when running directly from init.
  81. +.TP
  82. .BI siaddr\ ADDRESS
  83. BOOTP specific option. The default is
  84. .BR 0.0.0.0 .