[Initscripts-ng-commits] r755 - in /trunk/src/insserv/debian: changelog patches/00list patches/61_default_stop_changed_from_empty.dpatch patches/61_defaults_changed_from_empty.dpatch patches/64_missing_default_fields_fallback.dpatch

kelmo-guest at users.alioth.debian.org kelmo-guest at users.alioth.debian.org
Tue May 20 01:53:53 UTC 2008


Author: kelmo-guest
Date: Tue May 20 01:53:53 2008
New Revision: 755

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=755
Log:
Add 61_defaults_changed_from_empty to catch the cases demonstrated by
test_adding_start() and test_adding_stop() and disallow overwritten
initscript to create start or stop links when none were present initially.
(Closes: #477415)

Added:
    trunk/src/insserv/debian/patches/61_defaults_changed_from_empty.dpatch   (with props)
Removed:
    trunk/src/insserv/debian/patches/61_default_stop_changed_from_empty.dpatch
Modified:
    trunk/src/insserv/debian/changelog
    trunk/src/insserv/debian/patches/00list
    trunk/src/insserv/debian/patches/64_missing_default_fields_fallback.dpatch

Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=755&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Tue May 20 01:53:53 2008
@@ -21,9 +21,10 @@
     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.
-  * Add 61_default_stop_changed_from_empty to catch the case demonstrated by
-    test_adding_stop() and disallow overwritten initscript to create stop
-    links when none were present initially (Closes: #477415).
+  * Add 61_defaults_changed_from_empty to catch the cases demonstrated by
+    test_adding_start() and test_adding_stop() and disallow overwritten
+    initscript to create start or stop links when none were present initially.
+    (Closes: #477415)
   * Add test_onlystart() test case to check we can insert scripts with empty
     stop runlevel configuration.
   * Add test_broken_header() test case to show it seems possible to insert a
@@ -49,7 +50,7 @@
     modifies on disk configuration. Give test_adding_start and
     test_adding_stop test script unique names.
 
- -- Kel Modderman <kel at otaku42.de>  Tue, 20 May 2008 01:52:32 +1000
+ -- Kel Modderman <kel at otaku42.de>  Tue, 20 May 2008 11:50:11 +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=755&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/00list (original)
+++ trunk/src/insserv/debian/patches/00list Tue May 20 01:53:53 2008
@@ -10,7 +10,7 @@
 51_overwrite_output
 52_shutdown_links
 60_disable_cfgfilter_stat
-61_default_stop_changed_from_empty
+61_defaults_changed_from_empty
 62_warn_on_missing_required_fields
 63_warn_on_missing_default_fields
 64_missing_default_fields_fallback

Added: trunk/src/insserv/debian/patches/61_defaults_changed_from_empty.dpatch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/61_defaults_changed_from_empty.dpatch?rev=755&op=file
==============================================================================
--- trunk/src/insserv/debian/patches/61_defaults_changed_from_empty.dpatch (added)
+++ trunk/src/insserv/debian/patches/61_defaults_changed_from_empty.dpatch Tue May 20 01:53:53 2008
@@ -1,0 +1,77 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 61_defaults_changed_from_empty.dpatch by Kel Modderman <kel at otaku42.de>
+##
+## DP: Goal: When determining runlevel link scheme for a service, check if
+## DP: script has start _and_ stop links in runlevel configurations, to catch
+## DP: the cases where initial script Default-{Start,Stop} was empty and was
+## DP: later overriden.
+## DP:
+## DP: Fixes: #477415
+## DP:
+## DP: Status: Not yet sumbitted upstream. Contact has been made to rebase
+## DP: patch against development tree (not in version control).
+## DP:
+## DP: Notes: test_addingstart and test_adding_stop test suite cases exposes
+## DP: these situations. It also seems to generate noise in
+## DP: test_normal_sequence() during insertion for currently unknown reason.
+
+ at DPATCH@
+diff -urNad insserv~/insserv.c insserv/insserv.c
+--- insserv~/insserv.c	2008-05-20 11:22:39.584014387 +1000
++++ insserv/insserv.c	2008-05-20 11:22:39.778014324 +1000
+@@ -1996,6 +1996,8 @@
+     boolean del = false;
+     boolean defaults = false;
+     boolean ignore = false;
++    boolean startlinks = false;
++    boolean stoplinks = false;
+ 
+     myname = basename(*argv);
+ 
+@@ -2458,6 +2460,12 @@
+ 			    error("exiting now!\n");
+ 		    }
+ 
++		    if (service->lvls)
++		    	startlinks = true;
++
++		    if (service->lvlk)
++		    	stoplinks = true;
++
+ 		    if (script_inf.default_start && script_inf.default_start != empty) {
+ 		 	uint deflvls = str2lvl(script_inf.default_start);
+ 
+@@ -2476,6 +2484,16 @@
+ 					 d->d_name, lvl2str(service->lvls),
+ 					 lvl2str(deflvls));
+ 			    }
++			} else if (!defaults && !startlinks && stoplinks) {
++			    /*
++			     * Currently linked into service runlevel scheme, check
++			     * if the defaults are overwriten.
++			     */
++			    if (!del && chkfor(d->d_name, argv, argc) && !(argr[curr_argc])) {
++				warn("Warning, empty start runlevel(s) of script `%s' overwrites defaults (%s).\n",
++				     d->d_name, lvl2str(deflvls));
++				script_inf.default_start = empty;
++			    }
+ 			} else
+ 			    /*
+ 			     * Currently not linked into service runlevel scheme, info
+@@ -2517,6 +2535,16 @@
+ 					 d->d_name, lvl2str(service->lvlk),
+ 					 lvl2str(deflvlk));
+ 			    }
++			} else if (!defaults && !stoplinks && startlinks) {
++			    /*
++			     * Currently linked into service runlevel scheme, check
++			     * if the defaults are overwriten.
++			     */
++			    if (!del && chkfor(d->d_name, argv, argc) && !(argr[curr_argc])) {
++				warn("Warning, 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

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

Modified: trunk/src/insserv/debian/patches/64_missing_default_fields_fallback.dpatch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/64_missing_default_fields_fallback.dpatch?rev=755&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/64_missing_default_fields_fallback.dpatch (original)
+++ trunk/src/insserv/debian/patches/64_missing_default_fields_fallback.dpatch Tue May 20 01:53:53 2008
@@ -14,19 +14,9 @@
 
 @DPATCH@
 diff -urNad insserv~/insserv.c insserv/insserv.c
---- insserv~/insserv.c	2008-05-20 01:34:54.039015024 +1000
-+++ insserv/insserv.c	2008-05-20 01:35:21.229139187 +1000
-@@ -2503,9 +2503,6 @@
- 			     * 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
--			 */
- 		    }
- #endif /* USE_STOP_TAGS */
- 
-@@ -2540,23 +2537,29 @@
+--- insserv~/insserv.c	2008-05-20 09:03:51.156011876 +1000
++++ insserv/insserv.c	2008-05-20 09:04:18.929013402 +1000
+@@ -2507,11 +2507,6 @@
  			     * Could be a none LSB script, use info from current link scheme.
  			     */
  			    script_inf.default_start = lvl2str(service->lvls);
@@ -36,8 +26,19 @@
 -			     */
 -			    script_inf.default_start = xstrdup(DEFAULT_START_LVL);
  		    }
+ #ifdef USE_STOP_TAGS
+ 		    /*
+@@ -2554,9 +2549,6 @@
+ 			     * 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
+-			 */
+ 		    }
+ #endif /* USE_STOP_TAGS */
  		}
- 	    }
+@@ -2564,12 +2556,28 @@
  	    free(provides);
  	}
  
@@ -54,12 +55,16 @@
 +#endif /* Not SUSE */
  #ifdef USE_STOP_TAGS
 -	if (!script_inf.default_stop  || script_inf.default_start == empty)
--	    script_inf.default_stop  = xstrdup(DEFAULT_STOP_LVL);
++#ifdef SUSE
++	if (!script_inf.default_stop  || script_inf.default_stop == empty)
+ 	    script_inf.default_stop  = xstrdup(DEFAULT_STOP_LVL);
++#else /* SUSE */
 +	if (!script_inf.default_stop) {
 +	    warn("Default-Stop undefined, assuming empty stop runlevel(s) for script `%s'\n",
 +	         d->d_name);
-+	    script_inf.default_stop = empty;
++	    script_inf.default_stop  = empty;
 +	}
++#endif /* Not SUSE */
  #endif /* USE_STOP_TAGS */
  
  	if (chkfor(d->d_name, argv, argc) && !defaults) {




More information about the Initscripts-ng-commits mailing list