Hello community,
here is the log from the commit of package insserv for openSUSE:Factory
checked in at Mon Nov 29 12:20:56 CET 2010.
--------
--- insserv/insserv.changes 2010-06-28 08:48:47.000000000 +0200
+++ /mounts/work_src_done/STABLE/insserv/insserv.changes 2010-11-26 15:57:15.000000000 +0100
@@ -1,0 +2,7 @@
+Fri Nov 26 15:50:35 CET 2010 - werner@suse.de
+
+- Warn if dependencies are not done in all runlevel
+- Ignore real boot scripts for runlevel services as those
+ are already enabled.
+
+-------------------------------------------------------------------
@@ -52 +59 @@
-Wed Aug 19 12:07:58 CEST 200 - werner@suse.de
+Wed Aug 19 12:07:58 CEST 2009 - werner@suse.de
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ insserv.spec ++++++
--- /var/tmp/diff_new_pack.j3XUij/_old 2010-11-29 12:20:18.000000000 +0100
+++ /var/tmp/diff_new_pack.j3XUij/_new 2010-11-29 12:20:18.000000000 +0100
@@ -24,7 +24,7 @@
Provides: aaa_base:/sbin/insserv
AutoReqProv: on
Version: 1.14.0
-Release: 8
+Release: 13
Summary: A Program to Arrange Initialization Scripts
Url: http://savannah.nongnu.org/projects/sysvinit/
Source0: http://download.savannah.gnu.org/releases/sysvinit/insserv-%{version}.tar.bz2
++++++ insserv-1.14.0.dif ++++++
--- /var/tmp/diff_new_pack.j3XUij/_old 2010-11-29 12:20:18.000000000 +0100
+++ /var/tmp/diff_new_pack.j3XUij/_new 2010-11-29 12:20:18.000000000 +0100
@@ -1,6 +1,14 @@
--- insserv.c
-+++ insserv.c 2010-06-10 15:18:32.218925119 +0000
-@@ -389,8 +389,8 @@ static void reversereq(service_t *restri
++++ insserv.c 2010-11-26 14:43:54.159926470 +0000
+@@ -26,6 +26,7 @@
+ #define MINIMAL_MAKE 1 /* Remove disabled scripts from .depend.boot,
+ * .depend.start, .depend.halt, and .depend.stop */
+ #define MINIMAL_RULES 1 /* ditto */
++#define MINIMAL_DEPEND 1 /* Remove redundant dependencies */
+
+ #include
+ #include
+@@ -389,8 +390,8 @@ static void reversereq(service_t *restri
/*
* Check required services for name
*/
@@ -11,7 +19,7 @@
{
boolean ret = true;
list_t * pos;
-@@ -409,12 +409,23 @@ static boolean chkrequired(service_t *re
+@@ -409,12 +410,23 @@ static boolean chkrequired(service_t *re
must = getorig(must);
if ((must->attr.flags & (SERV_CMDLINE|SERV_ENABLED)) == 0) {
@@ -37,7 +45,7 @@
if (serv->attr.flags & (SERV_CMDLINE|SERV_ENABLED))
goto out;
np_list_for_each(pos, &serv->sort.rev) {
-@@ -425,9 +436,8 @@ static boolean chkrequired(service_t *re
+@@ -425,9 +437,8 @@ static boolean chkrequired(service_t *re
continue;
must = rev->serv;
must = getorig(must);
@@ -48,7 +56,7 @@
serv->name, rev->serv->name);
ret = false;
}
-@@ -476,7 +486,7 @@ static boolean chkdependencies(service_t
+@@ -476,7 +487,7 @@ static boolean chkdependencies(service_t
if ((cur->attr.flags & SERV_CMDLINE) && (flags & SERV_CMDLINE))
continue;
@@ -57,7 +65,134 @@
name, cur->name);
ret = false;
}
-@@ -1378,10 +1388,10 @@ static uchar scan_lsb_headers(const int
+@@ -738,7 +749,7 @@ static inline void makedep(void)
+ FILE *halt;
+ #endif /* USE_KILL_IN_BOOT */
+ const char *target;
+- service_t *serv;
++ const service_t *serv;
+
+ if (dryrun) {
+ #ifdef USE_KILL_IN_BOOT
+@@ -818,6 +829,10 @@ static inline void makedep(void)
+
+ target = (char*)0;
+ while ((serv = listscripts(&target, 'S', LVL_BOOT|LVL_ALL))) {
++#if defined(MINIMAL_DEPEND) && (MINIMAL_DEPEND != 0)
++ const service_t * lserv[100] = {0};
++ unsigned long lcnt = 0;
++#endif /* not MINIMAL_DEPEND */
+ boolean mark;
+ list_t * pos;
+
+@@ -841,6 +856,10 @@ static inline void makedep(void)
+ np_list_for_each(pos, &serv->sort.req) {
+ req_t * req = getreq(pos);
+ service_t * dep = req->serv;
++#if defined(MINIMAL_DEPEND) && (MINIMAL_DEPEND != 0)
++ boolean shadow = false;
++ unsigned long n;
++#endif /* not MINIMAL_DEPEND */
+ const char * name;
+
+ if (!dep)
+@@ -870,7 +889,36 @@ static inline void makedep(void)
+ fprintf(out, "%s:", target);
+ mark = true;
+ }
++#if defined(MINIMAL_DEPEND) && (MINIMAL_DEPEND != 0)
++ for (n = 0; n < lcnt && lserv[n] ; n++) {
++ list_t * red;
++ if (lserv[n]->attr.sorder <= dep->attr.sorder)
++ break;
++ np_list_for_each(red, &(lserv[n])->sort.req) {
++ req_t * other = getreq(red);
++ if (other->serv->attr.flags & SERV_DUPLET)
++ continue;
++ if (other->serv->attr.ref <= 0)
++ continue;
++ if ((serv->start->lvl & other->serv->start->lvl) == 0)
++ continue;
++ if (!other->serv->attr.script)
++ continue;
++ if (other->serv != dep)
++ continue;
++ shadow = true;
++ }
++ }
++ if (shadow)
++ continue;
++#endif /* not MINIMAL_DEPEND */
+ fprintf(out, " %s", name);
++
++#if defined(MINIMAL_DEPEND) && (MINIMAL_DEPEND != 0)
++ if (lcnt >= sizeof(lserv)/sizeof(lserv[0]))
++ continue;
++ lserv[lcnt++] = dep;
++#endif /* not MINIMAL_DEPEND */
+ }
+
+ if (mark) fputc('\n', out);
+@@ -927,6 +975,10 @@ static inline void makedep(void)
+
+ target = (char*)0;
+ while ((serv = listscripts(&target, 'K', (LVL_NORM|LVL_BOOT)))) {
++#if defined(MINIMAL_DEPEND) && (MINIMAL_DEPEND != 0)
++ const service_t * lserv[100] = {0};
++ unsigned long lcnt = 0;
++#endif /* not MINIMAL_DEPEND */
+ boolean mark;
+ list_t * pos;
+
+@@ -953,6 +1005,10 @@ static inline void makedep(void)
+ np_list_for_each(pos, &serv->sort.rev) {
+ req_t * rev = getreq(pos);
+ service_t * dep = rev->serv;
++#if defined(MINIMAL_DEPEND) && (MINIMAL_DEPEND != 0)
++ boolean shadow = false;
++ unsigned long n;
++#endif /* not MINIMAL_DEPEND */
+ const char * name;
+
+ if (!dep)
+@@ -976,7 +1032,36 @@ static inline void makedep(void)
+ fprintf(out, "%s:", target);
+ mark = true;
+ }
++#if defined(MINIMAL_DEPEND) && (MINIMAL_DEPEND != 0)
++ for (n = 0; n < lcnt && lserv[n]; n++) {
++ list_t * red;
++ if (lserv[n]->attr.korder <= dep->attr.korder)
++ break;
++ np_list_for_each(red, &(lserv[n])->sort.rev) {
++ req_t * other = getreq(red);
++ if (other->serv->attr.flags & SERV_DUPLET)
++ continue;
++ if (other->serv->attr.ref <= 0)
++ continue;
++ if ((serv->start->lvl & other->serv->start->lvl) == 0)
++ continue;
++ if (!other->serv->attr.script)
++ continue;
++ if (other->serv != dep)
++ continue;
++ shadow = true;
++ }
++ }
++ if (shadow)
++ continue;
++#endif /* not MINIMAL_DEPEND */
+ fprintf(out, " %s", name);
++
++#if defined(MINIMAL_DEPEND) && (MINIMAL_DEPEND != 0)
++ if (lcnt >= sizeof(lserv)/sizeof(lserv[0]))
++ continue;
++ lserv[lcnt++] = dep;
++#endif /* not MINIMAL_DEPEND */
+ }
+ if (mark) fputc('\n', out);
+ }
+@@ -1378,10 +1463,10 @@ static uchar scan_lsb_headers(const int
description = empty;
}
@@ -72,7 +207,7 @@
} else
interactive = empty;
}
-@@ -1416,7 +1426,7 @@ static uchar scan_lsb_headers(const int
+@@ -1416,7 +1501,7 @@ static uchar scan_lsb_headers(const int
char *name = basename(path);
if (*name == 'S' || *name == 'K')
name += 3;
@@ -81,7 +216,7 @@
if (!ignore)
error("exiting now!\n");
}
-@@ -1432,7 +1442,7 @@ static uchar scan_lsb_headers(const int
+@@ -1432,7 +1517,7 @@ static uchar scan_lsb_headers(const int
char *name = basename(path);
if (*name == 'S' || *name == 'K')
name += 3;
@@ -90,7 +225,7 @@
if (!provides)
warn("missing `Provides:' entry: please add.\n");
if (provides == empty)
-@@ -2338,17 +2348,18 @@ out:
+@@ -2338,17 +2423,18 @@ out:
static struct option long_options[] =
{
@@ -120,7 +255,7 @@
};
static void help(const char *restrict const name) attribute((nonnull(1)));
-@@ -2364,6 +2375,8 @@ static void help(const char *restrict co
+@@ -2364,6 +2450,8 @@ static void help(const char *restrict co
printf(" -o <path>, --override <path> Path to replace " OVERRIDEDIR ".\n");
printf(" -c <config>, --config <config> Path to config file.\n");
printf(" -n, --dryrun Do not change the system, only talk about it.\n");
@@ -129,7 +264,7 @@
printf(" -d, --default Use default runlevels a defined in the scripts\n");
}
-@@ -2386,6 +2399,8 @@ int main (int argc, char *argv[])
+@@ -2386,6 +2474,8 @@ int main (int argc, char *argv[])
boolean defaults = false;
boolean ignore = false;
boolean loadarg = false;
@@ -138,7 +273,7 @@
myname = basename(*argv);
-@@ -2400,7 +2415,7 @@ int main (int argc, char *argv[])
+@@ -2400,7 +2490,7 @@ int main (int argc, char *argv[])
for (c = 0; c < argc; c++)
argr[c] = (char*)0;
@@ -147,7 +282,7 @@
size_t l;
switch (c) {
case 'c':
-@@ -2445,6 +2460,9 @@ int main (int argc, char *argv[])
+@@ -2445,6 +2535,9 @@ int main (int argc, char *argv[])
goto err;
upstartjob_path = optarg;
break;
@@ -157,7 +292,16 @@
case '?':
err:
error("For help use: %s -h\n", myname);
-@@ -3000,8 +3018,10 @@ int main (int argc, char *argv[])
+@@ -2612,7 +2705,7 @@ int main (int argc, char *argv[])
+ * Scan scripts found in the command line to be able to resolve
+ * all dependcies given within those scripts.
+ */
+- if (argc > 1) for (c = 0; c < argc; c++) {
++ for (c = 0; c < argc; c++) {
+ const char *const name = argv[c];
+ service_t * first = (service_t*)0;
+ char * provides, * begin, * token;
+@@ -3000,8 +3093,10 @@ int main (int argc, char *argv[])
if (!del || (del && !isarg))
warn("script %s: service %s already provided!\n", d->d_name, token);
@@ -170,7 +314,7 @@
if (!del || (del && !ignore && !isarg))
continue;
-@@ -3064,9 +3084,9 @@ int main (int argc, char *argv[])
+@@ -3064,9 +3159,9 @@ int main (int argc, char *argv[])
if (del)
ok = chkdependencies(service);
else
@@ -182,36 +326,97 @@
}
if (script_inf.default_start && script_inf.default_start != empty) {
-@@ -3357,6 +3377,42 @@ int main (int argc, char *argv[])
+@@ -3357,6 +3452,103 @@ int main (int argc, char *argv[])
active_script();
/*
-+ * Check for recursive mode the existence of the required services
++ * Check if runlevels of required scripts are a real subset
++ * of the services handled here.
+ */
-+ if (recursive && !del && !ignore) {
-+ c = argc;
-+ while (c--) {
-+ service_t * cur;
-+ list_t * ptr;
-+ cur = findservice(argv[c]);
++ if (!del && !ignore) {
++ list_t * ptr;
++ list_for_each(ptr, s_start) {
++ service_t * cur = getservice(ptr);
++ ushort clvl = cur->start->lvl & ~LVL_SINGLE;
++ list_t * pos;
++
+ cur = getorig(cur);
+ if (list_empty(&cur->sort.req))
+ continue;
-+ np_list_for_each(ptr, &cur->sort.req) {
-+ req_t *req = getreq(ptr);
++
++ np_list_for_each(pos, &cur->sort.req) {
++ req_t *req = getreq(pos);
+ service_t * must;
-+
++
+ if ((req->flags & REQ_MUST) == 0)
+ continue;
+ must = req->serv;
+ must = getorig(must);
-+
-+ if (must->attr.flags & SERV_ENABLED)
++
++ /*
++ * Check for recursive mode the existence of the required services
++ */
++ if (cur->attr.flags & SERV_CMDLINE) {
++
++ if (must->attr.flags & SERV_ENABLED) {
++ ushort mlvl = must->start->lvl & ~LVL_SINGLE;
++
++ if ((mlvl & LVL_BOOT) && (clvl & LVL_BOOT) == 0)
++ continue;
++
++ if ((mlvl & clvl) == clvl)
++ continue;
++ if (recursive) {
++ must->start->lvl |= clvl;
++ must->stopp->lvl |= clvl;
++ continue;
++ }
++ clvl &= ~mlvl;
++ if ((must->attr.flags & SERV_WARNED) == 0)
++ warn("FATAL: service %s is missed in the runlevels %s to use service %s\n",
++ must->name, lvl2str(clvl), cur->name);
++ must->attr.flags |= SERV_WARNED;
++ waserr = true;
++ continue;
++ }
++ if ((must->attr.flags & (SERV_ENFORCE|SERV_KNOWN)) == SERV_ENFORCE) {
++ if ((must->attr.flags & SERV_WARNED) == 0)
++ warn("FATAL: service %s has to exists for service %s\n",
++ must->name, cur->name);
++ must->attr.flags |= SERV_WARNED;
++ waserr = true;
++ continue;
++ }
++ if (recursive) {
++ must->start->lvl |= clvl;
++ must->stopp->lvl |= clvl;
++ continue;
++ }
++ continue;
++ }
++ if ((cur->attr.flags & SERV_ENABLED) == 0)
+ continue;
-+
-+ if ((must->attr.flags & (SERV_ENFORCE|SERV_KNOWN)) == SERV_ENFORCE) {
-+ warn("FATAL: service %s has to exists for service %s\n",
-+ req->serv->name, cur->name);
++ if ((must->attr.flags & SERV_KNOWN) == 0) {
++ if ((must->attr.flags & SERV_WARNED) == 0)
++ warn("FATAL: service %s has to exists for service %s\n",
++ must->name, cur->name);
++ waserr = true;
++ must->attr.flags |= SERV_WARNED;
++ continue;
++ }
++ if (must->attr.flags & SERV_ENABLED) {
++ ushort mlvl = must->start->lvl & ~LVL_SINGLE;
++
++ if ((mlvl & LVL_BOOT) && (clvl & LVL_BOOT) == 0)
++ continue;
++
++ if ((mlvl & clvl) == clvl)
++ continue;
++ clvl &= ~mlvl;
++ if ((must->attr.flags & SERV_WARNED) == 0)
++ warn("FATAL: service %s is missed in the runlevels %s to use service %s\n",
++ must->name, lvl2str(clvl), cur->name);
++ must->attr.flags |= SERV_WARNED;
+ waserr = true;
+ }
+ }
@@ -225,7 +430,7 @@
* Sorry but we support only [KS][0-9][0-9]<name>
*/
if (maxstart > MAX_DEEP || maxstop > MAX_DEEP)
-@@ -3435,13 +3491,16 @@ int main (int argc, char *argv[])
+@@ -3435,13 +3627,16 @@ int main (int argc, char *argv[])
script = (char*)0;
while ((serv = listscripts(&script, 'X', lvl))) {
@@ -243,7 +448,7 @@
slink = false;
if ((serv->start->lvl & lvl) == 0)
goto stop;
-@@ -3616,7 +3675,7 @@ int main (int argc, char *argv[])
+@@ -3616,7 +3811,7 @@ int main (int argc, char *argv[])
script = (char*)0;
while ((serv = listscripts(&script, 'X', seek))) {
@@ -252,7 +457,7 @@
boolean found;
char * clink;
char mode;
-@@ -3624,6 +3683,9 @@ int main (int argc, char *argv[])
+@@ -3624,6 +3819,9 @@ int main (int argc, char *argv[])
if (*script == '$') /* Do not link in virtual dependencies */
continue;
@@ -263,8 +468,8 @@
if (serv->stopp->lvl & lvl) {
# ifndef USE_KILL_IN_BOOT
--- listing.c
-+++ listing.c 2010-06-15 12:20:38.314924987 +0000
-@@ -534,13 +534,11 @@ out:
++++ listing.c 2010-11-26 14:16:31.675926125 +0000
+@@ -534,19 +534,16 @@ out:
* Sort linked list of provides into start or stop order
* during this set new start or stop order of the serives.
*/
@@ -280,7 +485,13 @@
int order;
switch (type) {
-@@ -554,24 +552,51 @@ void lsort(const char type)
+ case 'K':
+ for (order = 0; order <= maxstop; order++) {
+- list_t * ptr, * safe;
+ list_for_each_safe(ptr, safe, d_start) {
+ dir_t * dir = getdir(ptr);
+ if (dir->stopp.deep == order)
+@@ -554,28 +551,54 @@ void lsort(const char type)
}
}
join(&sort, d_start);
@@ -339,7 +550,11 @@
break;
default:
for (order = 0; order <= maxstart; order++) {
-@@ -583,24 +608,52 @@ void lsort(const char type)
+- list_t * ptr, * safe;
+ list_for_each_safe(ptr, safe, d_start) {
+ dir_t * dir = getdir(ptr);
+ if (dir->start.deep == order)
+@@ -583,28 +606,54 @@ void lsort(const char type)
}
}
join(&sort, d_start);
@@ -398,9 +613,13 @@
-#endif /* SORT_REQUESTS */
break;
}
+-
+-
+ }
+ /*
--- listing.h
-+++ listing.h 2010-06-15 10:52:04.446925086 +0000
++++ listing.h 2010-06-18 15:52:03.715424383 +0000
@@ -158,6 +158,18 @@ static inline void delete(list_t *restri
initial(entry);
}
@@ -420,7 +639,15 @@
static inline void join(list_t *restrict list, list_t *restrict head) attribute((always_inline,nonnull(1,2)));
static inline void join(list_t *restrict list, list_t *restrict head)
{
-@@ -181,6 +193,24 @@ static inline boolean list_empty(list_t
+@@ -175,12 +187,30 @@ static inline void join(list_t *restrict
+ }
+ }
+
+-static inline boolean list_empty(list_t *restrict head) attribute((always_inline,nonnull(1)));
+-static inline boolean list_empty(list_t *restrict head)
++static inline boolean list_empty(const list_t *restrict const head) attribute((always_inline,nonnull(1)));
++static inline boolean list_empty(const list_t *restrict const head)
+ {
return head->next == head;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org