Author: kelmo-guest
Date: Sun May 18 01:44:53 2008
New Revision: 738

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=738
Log:
* Add 61_default_stop_changed_from_empty to catch the case demonstrated by
  test_adding_stop() and disallow overwrriten initscript to create stop
  links when none were present initially.
* Add 62_default_stop_no_defaults to inhibit initscripts from being "given"
  default stop links when none are wanted. Stop links should only be created
  when asked for, there are no really sane defaults.

Added:
    trunk/src/insserv/debian/patches/61_default_stop_changed_from_empty.dpatch  
 (with props)
    trunk/src/insserv/debian/patches/62_default_stop_no_defaults.dpatch   (with 
props)
Modified:
    trunk/src/insserv/debian/changelog
    trunk/src/insserv/debian/patches/00list

Modified: trunk/src/insserv/debian/changelog
URL: 
http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=738&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Sun May 18 01:44:53 2008
@@ -21,8 +21,14 @@
     or more services to define and provide a virtual facility.
   * Ensure custom insserv.conf.d/* files are cleaned after
     test_insserv_conf_d() in run-testsuite.
-
- -- Kel Modderman <[EMAIL PROTECTED]>  Fri, 16 May 2008 21:09:06 +1000
+  * Add 61_default_stop_changed_from_empty to catch the case demonstrated by
+    test_adding_stop() and disallow overwrriten initscript to create stop
+    links when none were present initially.
+  * Add 62_default_stop_no_defaults to inhibit initscripts from being "given"
+    default stop links when none are wanted. Stop links should only be created
+    when asked for, there are no really sane defaults.
+
+ -- Kel Modderman <[EMAIL PROTECTED]>  Sun, 18 May 2008 11:41:12 +1000
 
 insserv (1.11.0-8) unstable; urgency=low
 

Modified: trunk/src/insserv/debian/patches/00list
URL: 
http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/00list?rev=738&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/00list (original)
+++ trunk/src/insserv/debian/patches/00list Sun May 18 01:44:53 2008
@@ -10,3 +10,5 @@
 51_overwrite_output
 52_shutdown_links
 60_disable_cfgfilter_stat
+61_default_stop_changed_from_empty
+62_default_stop_no_defaults

Added: 
trunk/src/insserv/debian/patches/61_default_stop_changed_from_empty.dpatch
URL: 
http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/61_default_stop_changed_from_empty.dpatch?rev=738&op=file
==============================================================================
--- trunk/src/insserv/debian/patches/61_default_stop_changed_from_empty.dpatch 
(added)
+++ trunk/src/insserv/debian/patches/61_default_stop_changed_from_empty.dpatch 
Sun May 18 01:44:53 2008
@@ -1,0 +1,137 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 61_default_stop_changed_from_empty.dpatch by Kel Modderman <[EMAIL 
PROTECTED]>
+##
+## DP: When determining runlevel link scheme for a service, consider stop links
+## DP: before start links, so that we may determine if an existing script is
+## DP: already linked into a runlevel scheme but didn't initially provide
+## DP: stop links (valid configuration). Catch the case where a new script
+## DP: provides stop links without forcing default values to be used.
+
[EMAIL PROTECTED]@
+diff -urNad insserv~/insserv.c insserv/insserv.c
+--- insserv~/insserv.c 2008-05-18 11:26:14.000000000 +1000
++++ insserv/insserv.c  2008-05-18 11:26:59.000000000 +1000
+@@ -2458,83 +2458,90 @@
+                           error("exiting now!\n");
+                   }
+ 
+-                  if (script_inf.default_start && script_inf.default_start != 
empty) {
+-                      uint deflvls = str2lvl(script_inf.default_start);
++#ifdef USE_STOP_TAGS
++                  /*
++                   * default_stop arn't used in SuSE Linux.
++                   */
++                  if (script_inf.default_stop && script_inf.default_stop != 
empty) {
++                      uint deflvlk = str2lvl(script_inf.default_stop);
+ 
+                       /*
+                        * Compare all bits, which means `==' and not `&' and 
overwrite
+                        * the defaults of the current script.
+                        */
+-                      if (service->lvls) {
++                      if (service->lvlk || service->lvls) {
+                           /*
+                            * Currently linked into service runlevel scheme, 
check
+                            * if the defaults are overwriten.
+                            */
+-                          if (!defaults && (deflvls != service->lvls)) {
++                          if (!defaults && service->lvlk && (deflvlk != 
service->lvlk)) {
+                               if (!del && chkfor(d->d_name, argv, argc) && 
!(argr[curr_argc]))
+-                                  warn("Warning, current start runlevel(s) of 
script `%s' (%s) overwrites defaults (%s).\n",
+-                                       d->d_name, lvl2str(service->lvls),
+-                                       lvl2str(deflvls));
++                                  warn("Warning, current stop runlevel(s) of 
script `%s' (%s) overwrites defaults (%s).\n",
++                                       d->d_name, lvl2str(service->lvlk),
++                                       lvl2str(deflvlk));
++                          } else if (!defaults && !service->lvlk) {
++                              if (!del && chkfor(d->d_name, argv, argc) && 
!(argr[curr_argc])) {
++                                  warn("Warning, current empty stop 
runlevel(s) of script `%s' overwrites defaults (%s).\n",
++                                       d->d_name, lvl2str(deflvlk));
++                                  script_inf.default_stop = empty;
++                              }
+                           }
+                       } else
+                           /*
+                            * Currently not linked into service runlevel 
scheme, info
+                            * needed for enabling interactive services at 
first time.
+                            */
+-                          service->lvls = deflvls;
++                          service->lvlk = deflvlk;
+ 
+                   } else {
+-                      if (service->lvls)
++                      if (service->lvlk)
+                           /*
+                            * Could be a none LSB script, use info from 
current link scheme.
+                            */
+-                          script_inf.default_start = lvl2str(service->lvls);
+-                      else
+-                          /*
+-                           * Ahh ... set default multiuser with network
+-                           */
+-                          script_inf.default_start = 
xstrdup(DEFAULT_START_LVL);
++                          script_inf.default_stop = lvl2str(service->lvlk);
++                      /*
++                       * Do _not_ set default stop levels
++                       */
+                   }
+-#ifdef USE_STOP_TAGS
+-                  /*
+-                   * default_stop arn't used in SuSE Linux.
+-                   */
+-                  if (script_inf.default_stop && script_inf.default_stop != 
empty) {
+-                      uint deflvlk = str2lvl(script_inf.default_stop);
++#endif /* USE_STOP_TAGS */
++
++                  if (script_inf.default_start && script_inf.default_start != 
empty) {
++                      uint deflvls = str2lvl(script_inf.default_start);
+ 
+                       /*
+                        * Compare all bits, which means `==' and not `&' and 
overwrite
+                        * the defaults of the current script.
+                        */
+-                      if (service->lvlk) {
++                      if (service->lvls) {
+                           /*
+                            * Currently linked into service runlevel scheme, 
check
+                            * if the defaults are overwriten.
+                            */
+-                          if (!defaults && (deflvlk != service->lvlk)) {
++                          if (!defaults && (deflvls != service->lvls)) {
+                               if (!del && chkfor(d->d_name, argv, argc) && 
!(argr[curr_argc]))
+-                                  warn("Warning, current stop runlevel(s) of 
script `%s' (%s) overwrites defaults (%s).\n",
+-                                       d->d_name, lvl2str(service->lvlk),
+-                                       lvl2str(deflvlk));
++                                  warn("Warning, current start runlevel(s) of 
script `%s' (%s) overwrites defaults (%s).\n",
++                                       d->d_name, lvl2str(service->lvls),
++                                       lvl2str(deflvls));
+                           }
+                       } else
+                           /*
+                            * Currently not linked into service runlevel 
scheme, info
+                            * needed for enabling interactive services at 
first time.
+                            */
+-                          service->lvlk = deflvlk;
++                          service->lvls = deflvls;
+ 
+                   } else {
+-                      if (service->lvlk)
++                      if (service->lvls)
+                           /*
+                            * Could be a none LSB script, use info from 
current link scheme.
+                            */
+-                          script_inf.default_stop = lvl2str(service->lvlk);
+-                      /*
+-                       * Do _not_ set default stop levels
+-                       */
++                          script_inf.default_start = lvl2str(service->lvls);
++                      else
++                          /*
++                           * Ahh ... set default multiuser with network
++                           */
++                          script_inf.default_start = 
xstrdup(DEFAULT_START_LVL);
+                   }
+-#endif /* USE_STOP_TAGS */
+               }
+           }
+           free(provides);

Propchange: 
trunk/src/insserv/debian/patches/61_default_stop_changed_from_empty.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: trunk/src/insserv/debian/patches/62_default_stop_no_defaults.dpatch
URL: 
http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/62_default_stop_no_defaults.dpatch?rev=738&op=file
==============================================================================
--- trunk/src/insserv/debian/patches/62_default_stop_no_defaults.dpatch (added)
+++ trunk/src/insserv/debian/patches/62_default_stop_no_defaults.dpatch Sun May 
18 01:44:53 2008
@@ -1,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 62_default_stop_no_defaults.dpatch by Kel Modderman <[EMAIL PROTECTED]>
+##
+## DP: Do not set default Default-Stop value for valid lsb scripts.
+
[EMAIL PROTECTED]@
+diff -urNad insserv~/insserv.c insserv/insserv.c
+--- insserv~/insserv.c 2008-05-18 11:31:17.000000000 +1000
++++ insserv/insserv.c  2008-05-18 11:33:47.000000000 +1000
+@@ -2550,10 +2550,6 @@
+       /* Ahh ... set default multiuser with network */
+       if (!script_inf.default_start || script_inf.default_start == empty)
+           script_inf.default_start = xstrdup(DEFAULT_START_LVL);
+-#ifdef USE_STOP_TAGS
+-      if (!script_inf.default_stop  || script_inf.default_start == empty)
+-          script_inf.default_stop  = xstrdup(DEFAULT_STOP_LVL);
+-#endif /* USE_STOP_TAGS */
+ 
+       if (chkfor(d->d_name, argv, argc) && !defaults) {
+           if (argr[curr_argc]) {

Propchange: trunk/src/insserv/debian/patches/62_default_stop_no_defaults.dpatch
------------------------------------------------------------------------------
    svn:executable = *


_______________________________________________
Initscripts-ng-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/initscripts-ng-commits

Reply via email to